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

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

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

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

 vi /etc/ssh/sshd_config
  • 1

2.root用户只允许在如下ip登录

AllowUsers [email protected]
AllowUsers [email protected]
  • 1
  • 2

3.重启ssh生效

service sshd restart
  • 1

4.取消ip登录限制

如果取消ip登录限制,则删除AllowUsers项即可

猜你喜欢

转载自my.oschina.net/u/3367404/blog/2966877