2017-04-10 105 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/ –