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