我想限制来自除单个 IP 地址之外的所有用户的 root ssh 登录。
我的印象是我只需要将它添加到 /etc/pam.d/sshd:
account required pam_access.so
Run Code Online (Sandbox Code Playgroud)
这到/etc/security/access.conf:
-:root:ALL EXCEPT IPADDRESS
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用。
在 /etc/ssh/sshd_config
# Disable Root login
PermitRootLogin no
#
# [ . . . ]
#
# At the end of the file, add:
#
# Allow Root Login via Key from Admin Bastion
Match Address 10.9.8.7
PermitRootLogin without-password
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
17445 次 |
最近记录: |