Ita*_*not 41 linux ssh centos6
我在 CentOS 6.5 机器上安装了 Google-Authenticator 并配置了某些用户以提供 OTP。
在编辑时,/etc/ssh/sshd_config我看到一个指令“ PermitRootLogin”,默认情况下被注释掉。
我想设置“ PermitRootLogin no”,但仍然只能从本地网络以 root 身份通过 ssh 连接到机器。
那可能吗?
Sve*_*ven 62
使用Matchconfig 参数/etc/ssh/sshd_config:
# general config
PermitRootLogin no
# the following overrides the general config when conditions are met.
Match Address 192.168.0.*
PermitRootLogin yes
Run Code Online (Sandbox Code Playgroud)
看 man sshd_config
Lek*_*eyn 15
该Match address方法已经提到,但您也可以限制允许登录系统的用户(或组)。例如,要限制用户itai(从任何地方)和root(从特定网络)登录,请使用:
AllowUsers itai root@192.168.0.*
Run Code Online (Sandbox Code Playgroud)
这可以防止所有其他用户(如apache)通过 SSH 登录。
另请参阅sshd_config(5)手册中的AllowUsers关键字。
| 归档时间: |
|
| 查看次数: |
16317 次 |
| 最近记录: |