2017-04-10 51 views
1

我无法设置无密码访问树莓派。我正在使用类似的说明,如one。但它仍然要求密码,当我 ssh我的树莓。我与其他服务器做了这一切,一切运行良好,但没有与我的树莓(他们两个)。通过ssh无密码访问树莓派

感谢Jakuje,成为一点点清晰的:

成功调试日志:

debug1: Offering RSA public key: /home/tmp/.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 60 
debug1: Server accepts key: pkalg ssh-rsa blen 535 
debug2: input_userauth_pk_ok: fp SHA256:XPQA6tgcRCam/L18YP4ccPwsOsGtO65ippi7kua4mTM 
debug3: sign_and_send_pubkey: RSA SHA256:XPQA6tgcRCam/L18YP4ccPwsOsGtO65ippi7kua4mTM 
debug3: send packet: type 50 
debug3: receive packet: type 52 
debug1: Authentication succeeded (publickey). 

失败登录:

debug1: Offering RSA public key: /home/tmp/.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/tmp/.ssh/id_dsa 
debug3: no such identity: /home/tmp/.ssh/id_dsa: No such file or directory 
debug1: Trying private key: /home/tmp/.ssh/id_ecdsa 
debug3: no such identity: /home/tmp/.ssh/id_ecdsa: No such file or directory 
debug1: Trying private key: /home/tmp/.ssh/id_ed25519 
debug3: no such identity: /home/tmp/.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 

为什么它忽略id_rsa键并要求id_dsa? ?

+0

你做了哪些措施,使工作?调试日志是怎样的?没有这一点,这是不可能回答的。 – Jakuje

+0

链接指示在帖子中。我执行它们,PI仍然要求输入密码。你需要什么日志 - 我应该执行哪些命令或它所在的位置?我会给你 - 没有问题 –

+0

'ssh -vvv raspberry-ip' – Jakuje

回答

2
debug1: Offering RSA public key: /home/tmp/.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 

表示密钥已尝试但未被服务器接受。服务器配置/权限会有问题。以调试模式运行服务器可确定问题所在。在主目录的所有者和权限,.ssh目录应该是以下几点:

chmod g-w /home/your_user 
hmod 700 /home/your_user/.ssh 
chmod 600 /home/your_user/.ssh/authorized_keys 
+0

是的,这是我的情况下http ://www.daveperrett.com/articles/2010/09/14/ssh-authentication-refused/ –