无法在 Raspbian 上使用 rsa 密钥登录

无法在 Raspbian 上使用 rsa 密钥登录

我已经安装了 Raspbian 系统,并且想使用我的私钥通过 ssh 连接到它。我也在其他服务器上使用此密钥,因此我确信 chmod 在本地设置良好。

当我尝试 ssh 到 Raspbian 时,会发生这种情况:

debug1: SSH2_MSG_NEWKEYS received
debug2: key: /home/nagyviktor/.ssh/id_rsa (0x55c3847112d0), agent
debug1: Skipping ssh-dss key /home/nagyviktor/.ssh/id_dsa - not in PubkeyAcceptedKeyTypes
debug2: key: /home/nagyviktor/.ssh/id_ecdsa ((nil))
debug2: key: /home/nagyviktor/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/nagyviktor/.ssh/id_rsa
debug3: send_pubkey_test
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
debug1: Trying private key: /home/nagyviktor/.ssh/id_ecdsa
debug3: no such identity: /home/nagyviktor/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/nagyviktor/.ssh/id_ed25519
debug3: no such identity: /home/nagyviktor/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

我应该在配置中更改什么才能使 rsa 密钥被接受?

答案1

密钥被拒绝。这意味着您没有在服务器端正确设置它。最简单的事情是

ssh-copy-id user@raspberry-ip

如果您想手动检查配置,请查看所有主目录、~/.ssh/目录和authorized_keys其中的文件的所有者和权限。

相关内容