2016-09-12 41 views
-1

這裏是我做過什麼:無法創建通過按鍵與openssh的驗證SSH會話,成爲瘋狂

客戶端: =>生成2個鍵與ssh-keygen -t rsa

=>發送id_rsa.pub服務器(與SCP),並把它的〜/ .ssh/authorized_keys中

服務器:在/ etc/SSH/shd_config:

=>未註釋AuthorizedKeysFile%H /的.ssh/authorized_keys中

=>的PasswordAuthentication沒有

=> UsePAM沒有

我服務器重新啓動:服務sshd的重新啓動

問題:當我嘗試連接「ssh [email protected]_Server -v」後,我把我的密碼。

我得到以下日誌:

Enter passphrase for key '/root/.ssh/id_rsa': 
debug3: sign_and_send_pubkey: RSA SHA256:HMjzNl/zNrs...3m6SYDQ64ZoHeL6k 
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 
debug1: Trying private key: /root/.ssh/id_dsa 
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory 
debug1: Trying private key: /root/.ssh/id_ecdsa 
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory 
debug1: Trying private key: /root/.ssh/id_ed25519 
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory 
debug2: we did not send a packet, disable method 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

你有這個地方原木來自任何想法?

乾杯

+0

'嘗試私鑰:/root/.ssh/id_dsa debug3:沒有這樣的標識:/root/.ssh/id_dsa:沒有這樣的文件或目錄'這是你需要檢查的。檢查私鑰的路徑 – Hrabosch

+0

@Hrabosch確實沒有id_dsa,但這是因爲我只在/root/.ssh中放入了id_rsa,而我只是想使用rsa鍵... – mric750

+0

@Hrabosch我不明白爲什麼openssh繼續查找其他密鑰 – mric750

回答

0

好吧,我認爲這是authorized_keys目錄,並把公鑰它。但實際上它是一個文件!解決了 !