没有密码的 PermitRootLogin 不起作用

use*_*107 6 ssh root 14.04

我按照https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets 上的第六步进行操作,但是当我尝试连接到服务器时仍然收到密码提示使用来自其他没有私钥的机器的 ssh。

故障排除想法?谢谢

mur*_*uru 6

这是正常的行为。系统将提示您输入密码,但如果PermitRootLogin without-password已设置,则密码无效。如果您根本不想被提示输入密码,请在您的sshd_config

PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)

如果您只想拒绝它root,请尝试:

Match User root
    PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)