权限被拒绝(publickey)AWS

时间:2013-08-22 09:01:46

标签: amazon-web-services amazon-ec2 cygwin public-key

我知道这是一个FAQ。但我是新手。我经历了所有给定的解决方案。但似乎没有什么能解决我的问题

以下将更好地解释你。

ssh -v -i xxxxx-ec2.pem ubuntu@ec2-xx.xx.xx.xx.us-west-2.compute.amazonaws.com

我正在

    OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/Administrator/.ssh/config
debug1: Connecting to ec2-xx-xxx-x-xx.us-west-2.compute.amazonaws.com [xx.xxx.x.xx] port 22.
debug1: Connection established.
debug1: identity file xxxxx-ec2.pem type -1
debug1: identity file xxxxx-ec2.pem-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_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH_5*
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: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA a6:6e:d1:d2:ec:73:f5:d7:5f:97:33:b7:6b:ef:ff:02
debug1: Host 'ec2-xx-xxx-x-xx.us-west-2.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/Administrator/.ssh/known_hosts:3
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: Trying private key: venkat-ec2.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).

实际上我错误地删除了我在试图解决上述问题时在home / ubuntu文件夹中的xxxxx.pub。但我使用

生成了.pub文件
ssh-keygen -y 

然后通过SFTP将.pub文件粘贴回文件夹/home/ubuntu/。请帮帮我。

1 个答案:

答案 0 :(得分:0)

您需要在/home/ubuntu/.ssh/authorized_keys或/home/ubuntu/.ssh/authorized_keys2中添加.pub的新内容。

另一种方法是使用ssh-copy-id