centos设置ssh安全只容许用户从指定的IP登录

centos设置ssh安全只容许用户从指定的IP登录

2018年08月30日 18:26:28 何超杰 阅读数:1450centos

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

vi /etc/ssh/sshd_config
  • 1

2.root用户只容许在以下ip登陆

AllowUsers root@203.212.4.117
AllowUsers root@124.202.206.14
  • 1
  • 2

3.重启ssh生效

service sshd restart
  • 1

4.取消ip登陆限制

若是取消ip登陆限制,则删除AllowUsers项便可安全

相关文章
相关标签/搜索