不允许使用 RSA 密钥

zor*_*red 4 linux ssh centos keychain sshd

我无法在新的 VDS 服务器上配置 SSH 密钥身份验证。完成后ssh-copy-id我仍然收到用户密码提示。

为了调试,我添加LogLevel DEBUG3/etc/ssh/sshd_config重新启动systemctl restart sshd,并在日志中看到/var/log/secure以下消息:

不允许使用 RSA 密钥

为什么会发生这种情况以及如何解决它?

zor*_*red 5

出于安全原因, OpenSSH默认禁用RSA 方案。

因此,最好的选择是使用更安全的算法创建新的本地密钥:

ssh-keygen -t ed25519
Run Code Online (Sandbox Code Playgroud)