ssh 黑白名单

ssh安全问题虽然不是特别的重要,但是如果被别人暴力破取的话那么可想而知了

1,/etc/hosts.allow  /etc/hosts.deny

先把需要允许的ip加入到hosts.allow,如下:

vi /etc/hosts.allow

sshd:201.53.22.11

sshd:10.                 #这个意思是允许10开头的所有服务器

vi /etc/hosts.deny

sshd:all                  #拒绝全部

2,iptables 

iptables -I INPUT -p tcp -s ip --dport 2022 -j ACCEPT

原文地址:https://www.cnblogs.com/zenghui940/p/4735813.html