Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services ssh连接>;权限被拒绝(公钥)。Ubuntu 12.04 EC2_Amazon Web Services_Ssh_Amazon Ec2_Key_Rsa - Fatal编程技术网

Amazon web services ssh连接>;权限被拒绝(公钥)。Ubuntu 12.04 EC2

Amazon web services ssh连接>;权限被拒绝(公钥)。Ubuntu 12.04 EC2,amazon-web-services,ssh,amazon-ec2,key,rsa,Amazon Web Services,Ssh,Amazon Ec2,Key,Rsa,一小时前我正在使用我的EC2实例,我使用scp将我的网页上传到我的服务器,一切都很好。我用exit命令关闭了连接,现在我正尝试使用与以前相同的命令登录,我得到了以下信息: $ ssh -v -i /cygdrive/c/tsearch.pem ubuntu@tsearch.com.mx OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012 debug1: Connecting to tsearch.com.mx [54.201.232.244] port 22. d

一小时前我正在使用我的EC2实例,我使用scp将我的网页上传到我的服务器,一切都很好。我用exit命令关闭了连接,现在我正尝试使用与以前相同的命令登录,我得到了以下信息:

$ ssh -v -i /cygdrive/c/tsearch.pem ubuntu@tsearch.com.mx
OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
debug1: Connecting to tsearch.com.mx [54.201.232.244] port 22.
debug1: Connection established.
debug1: identity file /cygdrive/c/tsearch.pem type -1
debug1: identity file /cygdrive/c/tsearch.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_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.1
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 3f:d4:cb:c0:db:7b:49:5e:0a:dc:1b:ec:4f:23:14:c3
debug1: Host 'tsearch.com.mx' is known and matches the ECDSA host key.
debug1: Found key in /home/Fernando/.ssh/known_hosts:6
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: /cygdrive/c/tsearch.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,而无需重新启动。然后使用刚才创建的AMI重新启动另一个实例。稍后,您可以更改DNS(或弹性IP)以指向新实例


您是否更改了实例中~/.ssh/authorized_密钥中的任何内容。或者您在Windows/Cygwin计算机上更改了私钥上的任何内容吗?没有,任何内容。我刚刚发出了一个scp命令,然后所有的命令都被更改了……您在哪里
scp
准确地插入到了实例中。很有可能是您重写了
~/.ssh
的内容。您是否修改了密钥?非常感谢,这就是我需要做的来修复此wierd问题