SSH 公钥登录失败

SSH 公钥登录失败

我最近设置了一个新的 Synology NAS,并尝试在新系统上复制我的公钥 SSH 访问(未成功)。我确保:

  • 我的本地 SSH 配置使用相同的私钥登录两个 Synology 系统
  • 两个 Synology 系统在 .ssh/authorized_keys 中都有相同(对应)的公钥
  • /etc/ssh/sshd_config 在两个 Synology 系统上都已同步(即允许 PubKeyAuthentication),并且已重新启动服务以确保使用了正确的设置
  • 两个 Synology 系统上的 .ssh/ 和 authorized_keys 权限均已正确设置(700 和 600)

在旧版 Synology 上,ssh -vvv 可

debug1: Offering public key: /Users/xxx/.ssh/synology_key RSA SHA256:xxxx explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /Users/xxx/.ssh/synology_key RSA SHA256:xxxx explicit

但在新的密钥上,相同的密钥被拒绝

debug1: Offering public key: /Users/xxx/.ssh/synology_key RSA SHA256:xxxx explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,password).

使用我的密码进行 SSH 登录在两个系统上都有效。我还可以检查什么来调试?谢谢!

答案1

问题已解决:我的新 Synology 系统上的用户主目录具有不正确的权限(s。https://blog.aaronlenoir.com/2018/05/06/ssh-into-synology-nas-with-ssh-key/)。

相关内容