1.编辑文件 /etc/ssh/sshd_config vi /etc/ssh/sshd_config2.root用户只允许在如下ip登录AllowUsers root@203.212.4.117AllowUsers root@124.202.206.14 3.重启ssh生效service sshd restart 4.取消ip登录限制如果取消ip登录限制,则删除AllowUsers项即可