尝试登录实例时,QWS OpsWorks“权限被拒绝(publickey)”

时间:2015-05-26 15:28:59

标签: amazon-web-services ssh amazon aws-opsworks

我在OpsWorks中有2个实例。 第一个我可以使用ssh登录。 第二个,如果我添加一个EBS卷,并将其挂载到“/ mnt / data”或其他任何地方,当我尝试登录时,我得到:

"Permission Denied (publickey)"

到ssh我用:

"ssh -v ubuntu@10.0.2.184"

这是完整的日志:

OpenSSH_6.2p2, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 50: Applying options for *
debug1: Connecting to 10.0.2.184 [10.0.2.184] port 22.
debug1: Connection established.
debug1: identity file /home/ec2-user/.ssh/id_rsa type -1
debug1: identity file /home/ec2-user/.ssh/id_rsa-cert type -1
debug1: identity file /home/ec2-user/.ssh/id_dsa type -1
debug1: identity file /home/ec2-user/.ssh/id_dsa-cert type -1
debug1: identity file /home/ec2-user/.ssh/id_ecdsa type -1
debug1: identity file /home/ec2-user/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA de:82:9f:df:1a:a6:b3:59:11:c5:93:f9:95:57:d4:49
debug1: Host '10.0.2.184' is known and matches the ECDSA host key.
debug1: Found key in /home/ec2-user/.ssh/known_hosts:48
debug1: ssh_ecdsa_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: imported-openssh-key
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: imported-openssh-key
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: imported-openssh-key
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/ec2-user/.ssh/id_rsa
debug1: Trying private key: /home/ec2-user/.ssh/id_dsa
debug1: Trying private key: /home/ec2-user/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).

如果我没有安装EBS卷,那么它就可以正常登录。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

如果它是Amazon Linux EC2实例,那么您应该以 ec2-user 用户身份登录,而不是以 ubuntu 用户身份登录。所以,ssh -v ec2-user@10.0.2.184。

相关问题