Centos 7 设置ssh只允许特定用户从指定的IP登录

1.编辑文件 /etc/ssh/sshd_config
vi /etc/ssh/sshd_config

2.root用户只允许在如下ip登录
AllowUsers root@203.212.4.117
AllowUsers root@124.202.206.14
 
3.重启ssh生效
service sshd restart
  
4.取消ip登录限制
如果取消ip登录限制,则删除AllowUsers项即可
 

posted @ 2019-03-25 17:09  Mr.peter  阅读(1986)  评论(0)    收藏  举报