linux – 如何仅允许ssh从本地网络root用户?

前端之家收集整理的这篇文章主要介绍了linux – 如何仅允许ssh从本地网络root用户?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_301_1@我在CentOS 6.5计算机上安装了Google-Authenticator,并为某些用户配置了OTP.

编辑/ etc / ssh / sshd_config时,我看到了一个默认注释掉的指令“PermitRootLogin”.

我想设置“PermitRootLogin no”,但仍然只能从本地网络以root身份ssh到机器.

那可能吗?

解决方法

@H_502_11@ 使用/ etc / ssh / sshd_config中的Match配置参数:
  1. # general config
  2. PermitRootLogin no
  3.  
  4. # the following overrides the general config when conditions are met.
  5. Match Address 192.168.0.*
  6. PermitRootLogin yes

请参阅man sshd_config

猜你在找的Linux相关文章