如果本機「.ssh」目錄中存在「id_rsa.pub」文件,為什麼 ssh 連線失敗?

如果本機「.ssh」目錄中存在「id_rsa.pub」文件,為什麼 ssh 連線失敗?

我只是注意到如果id_rsa.pub存在於本地~/.ssh目錄中,我無法使用ssh命令連接遠端伺服器。

但我不知道為什麼會這樣。如果公鑰與私鑰存在於同一位置,對安全有危險嗎?

ssh即使我使用選項運行命令,我也沒有收到指示公鑰不應放置在那裡的錯誤-v

為什麼我不能將公鑰放入~/.ssh/

ssh這是帶有選項的日誌的一部分-v。我ssh在cygwin環境下使用。

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/ironsand/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /home/ironsand/.ssh/id_dsa
debug1: Trying private key: /home/ironsand/.ssh/id_ecdsa
debug1: Trying private key: /home/ironsand/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

相關內容