
我无法通过 ssh 进入我的机器 - ssh 进程似乎没有尝试正确的密钥(我可能错了)。顺便说一句,这是在重启之后。
通常使用的密钥对是:
/Users/mingyeow/.ssh/id_rsa-gsg-keypair
无法在重启的机器上通过 SSH 连接
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/mingyeow/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/mingyeow/.ssh/identity
debug1: Trying private key: /Users/mingyeow/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
成功通过 SSH 连接到同一 EC2 帐户上的另一台机器
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/mingyeow/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering public key: /Users/mingyeow/.ssh/id_rsa-gsg-keypair
debug1: Server accepts key: pkalg ssh-rsa
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
答案1
尝试 :
ssh -i ~/.ssh/id_rsa-gsg-keypair [email protected]
如果有效,那么将以下内容粘贴到你的~/.ssh/config
Host *amazonaws.com
IdentityFile ~/.ssh/id_rsa-gsg-keypair