Ssh

嘗試 ssh 進入 ec2 機器時權限被拒絕(公鑰)(包括 -v 詳細資訊)

  • September 6, 2010

我無法 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).

成功在同一 EC2 帳戶上的另一台電腦上進行 SSH

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 no-more-sessions@openssh.com
debug1: Entering interactive session.

嘗試 :

ssh -i ~/.ssh/id_rsa-gsg-keypair user@...amazonaws.com

如果可行,請在您的~/.ssh/config

Host *amazonaws.com
   IdentityFile ~/.ssh/id_rsa-gsg-keypair

引用自:https://serverfault.com/questions/178495