2012-12-08 104 views
1

我的第一個密鑰對(eyelid_s.pem)工作正常。我使用這個密鑰對來訪問個人使用的實例。亞馬遜EC2權限被拒絕(公鑰)我創建的每個新密鑰對

現在我想創建一個新的實例供團隊使用,所以我創建了一個新的密鑰對(SE_Server.pem)作爲新實例的默認密鑰對。但它不起作用。即使是舊的pem也不適用於新的實例。我在第一個實例上嘗試了新的密鑰對,但它們也不起作用。

我已經做到了這一點:

chmod 400 SE_Server.pem 

所以這不應該是文件權限問題。

OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011 
debug1: Reading configuration data /etc/ssh_config 
debug1: /etc/ssh_config line 20: Applying options for * 
debug1: Connecting to ec2-23-20-118-96.compute-1.amazonaws.com [2001:778::ffff:64:0:1714:7660] port 22. 
debug1: Connection established. 
debug1: identity file /Users/Lynn/.ssh/id_rsa type 1 
debug1: identity file /Users/Lynn/.ssh/id_rsa-cert type -1 
debug1: identity file /Users/Lynn/.ssh/id_dsa type -1 
debug1: identity file /Users/Lynn/.ssh/id_dsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze2 
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze2 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.9 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr hmac-md5 none 
debug1: kex: client->server aes128-ctr hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Server host key: RSA 4d:28:fd:e1:aa:ba:89:9a:6e:e7:b3:d7:fa:15:bd:af 
debug1: Host 'ec2-23-20-118-96.compute-1.amazonaws.com' is known and matches the RSA host key. 
debug1: Found key in /Users/Lynn/.ssh/known_hosts:1 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /Users/Lynn/.ssh/id_rsa 
debug1: Authentications that can continue: publickey 
debug1: Offering RSA public key: /Users/Lynn/eyelid_s.pem 
debug1: Authentications that can continue: publickey 
debug1: Offering RSA public key: SE_Server_key.pem 
debug1: Authentications that can continue: publickey 
debug1: Trying private key: /Users/Lynn/.ssh/id_dsa 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

如果有人能幫助我,我真的很感激!這真的很煩人,因爲我無法訪問我的新實例。

+0

每個實例可以有單個Amazon密鑰。檢查您是否使用與啓動它相同的密鑰連接您的實例。您可以使用AWS控制檯或API工具進行檢查。順便說一句,一旦你開始新的實例,我建議你部署自己的公鑰,這樣你就不必在每次ssh時添加'-i path/to/your.pem'。 –

回答

0

您可以擁有多個密鑰(不在AWS控制檯中,但可以使用它們ssh登錄到您的計算機上),只要確保根據您的ssh版本將它們添加到「authorized_keys」或「authorized_keys2」中即可。

http://www.idrix.fr/Root/Samples/pubkey2ssh.c - 一種導入.pem的方法,但是我確定有其他的方法。

相關問題