CentOS限制SSH登录地址

编辑hosts.allow文件,将允许连接的地址写进去

[root@Elements ~]# vim /etc/hosts.allow
sshd:10.10.10.1:allow
sshd:172.16.203.1:allow
sshd:192.168.1.1:allow

在hosts.deny文件中写入禁止所有

[root@Elements ~]# vim /etc/hosts.deny
sshd:ALL

重启sshd服务

CentOS 6 :service sshd restart
CentOS 7 :systemctl restart sshd.service

猜你喜欢

转载自www.cnblogs.com/LuckWJL/p/9804580.html
今日推荐