【发布时间】:2016-06-20 23:11:19
【问题描述】:
我希望能够使用密码连接到 root@localhost,并且仅使用私钥从外部 (root@my-ip) 连接。我没有找到在 /etc/ssh/sshd_config 中写什么来允许这个……如果它需要 SSH 密钥和密码也可以。
你有什么想法吗?
【问题讨论】:
我希望能够使用密码连接到 root@localhost,并且仅使用私钥从外部 (root@my-ip) 连接。我没有找到在 /etc/ssh/sshd_config 中写什么来允许这个……如果它需要 SSH 密钥和密码也可以。
你有什么想法吗?
【问题讨论】:
这取决于你的 openssh 版本,但在最近的版本中,你可以设置:
PermitRootLogin prohibit-password
Match LocalAddress 127.0.0.1,::1 # localhost
PermitRootLogin yes
或使用您的版本 (PasswordAuthentication) 支持的其他等效项。
【讨论】: