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

我在CentOS 6.5计算机上安装了Google-Authenticator,并为某些用户配置了OTP.

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

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

那可能吗?

解决方法

使用/ etc / ssh / sshd_config中的Match配置参数:
# general config
PermitRootLogin no 

# the following overrides the general config when conditions are met. 
Match Address  192.168.0.*
    PermitRootLogin yes

请参阅man sshd_config

相关文章

文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限...
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Wi...
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Lin...
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,...
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 Open...