Ec2拒绝允许我通过SSH登录

时间:2013-12-25 00:10:03

标签: amazon-web-services ssh amazon-ec2

到目前为止,我一直在使用Amazon EC2 Instance运行ubuntu主要使用django / python配置,但这次我想使用LAMP ami(具有相同的安全组),并且它拒绝允许我登录:

Permission denied (publickey).
new-host:~ user$ ssh -v -i ThrowAwayEC2Server.pem ubuntu@xx.xxx.xx.xxx
OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug1: Connecting to xx.xxx.xx.xxx [xx.xxx.xx.xxx] port 22.
debug1: Connection established.
debug1: identity file ThrowAwayEC2Server.pem type -1
debug1: identity file ThrowAwayEC2Server.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 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 e7:ef:60:19:a8:cf:e6:04:9a:9c:f9:a7:b2:12:a5:4b
debug1: Host 'xx.xxx.xx.xxx' is known and matches the RSA host key.
debug1: Found key in /Users/user/.ssh/known_hosts:21
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/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: ThrowAwayEC2Server.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

任何人都知道为什么这不起作用?我试过了:

  • 不同的ami(基于灯,有些bitnami)
  • 使用全新的.pem文件

有人可以帮忙吗?你看到的任何错误都在发生吗?

谢谢!

不同的ami

1 个答案:

答案 0 :(得分:0)

这对连接字符串的语法来说不是问题,而是用户名错误。

如果您尝试连接到 bitnami ,社区驱动的ami - 用户名是bitnami,例如:

ssh -i yourkeyfile.pem bitnami@ec2-xxx-xxx-xxx-xx.compute-1.amazonaws.com