
我只是注意到如果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).