CentOS限制SSH登录地址

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

1
2
3
4
[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文件中写入禁止所有

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

重启sshd服务

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

 

posted @   Chuyio  阅读(1326)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示