我们的服务器集群为救援目的启用了远程 root 访问,我们通常设置为PermitRootLogin prohibit-password,/etc/ssh/sshd_config因为 LDAP 用户仍然可以使用密码登录。
最近我们添加了一个额外的服务器,具有非常严格的访问控制,我们PasswordAuthentication设置为 no 以便只有具有 SSH 密钥的特定用户才能登录。然而,默认设置PermitRootLogin yes保持了一段时间未被注意到。(这不是一个真正的问题,因为我们还删除了 root 用户的密码,因此除非直接在 KVM 控制台上,否则没有人可以登录。)
我的问题是,使用PasswordAuthentication noset,是否PermitRootLogin yes与prohibit-password?
prohibit-password意味着使用任何允许的机制进行身份验证,而不是密码和非键盘交互。见sshd_config PermitRootLogin
PasswordAuthentication no显然,只是意味着使用任何允许的非密码机制进行身份验证。见sshd_config PasswordAuthentication
因此,答案是否定的。
此外,prohibit-password特定于 root 帐户,PasswordAuthentication no是影响所有帐户的全局设置。
但是请注意,如果您不使用键盘交互,那么答案是肯定的(仅考虑 root 帐户)
| 归档时间: |
|
| 查看次数: |
22148 次 |
| 最近记录: |