首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Amazon EC2 ssh登录失败

Amazon EC2 ssh登录失败
EN

Stack Overflow用户
提问于 2011-02-09 19:04:47
回答 2查看 2.8K关注 0票数 1

我正在尝试登录到我在EC2上的实例,但到目前为止还没有成功。我提供了所有相关命令和我尝试过的内容的输出。我已经做了我的家庭作业和环顾四周,我仍然无法解释为什么我无法登录。

密钥对是使用amazons AWS控制台在线生成的,我将私有文件下载到了本地。现在是600了。

代码语言:javascript
复制
$ ec2-describe-keypairs 
KEYPAIR gsg-keypair bb:ac:f0:5f:5b:c8:24:47:16:a8:93:35:37:1c:b3:c3:84:68:80:e1

$ ec2-run-instances ami-8d18f5e4 -k gsg-keypair
INSTANCE    i-2dcea041  ami-8d18f5e4            pending gsg-keypair 0   m1.small    2011-02-09T10:50:50+0000    us-east-1c  aki-a71cf9ce    ari-a51cf9cc        monitoring-disabled                 instance-store              xen 

$ ec2-describe instances
INSTANCE    i-2dcea041  ami-8d18f5e4    ec2-75-101-249-242.compute-1.amazonaws.com  domU-12-31-39-00-5D-D2.compute-1.internal   running gsg-keypair 0       m1.smal2011-02-09T10:50:50+0000 us-east-1c  aki-a71cf9ce    ari-a51cf9cc        monitoring-disabled 75.101.249.242  10.254.98.32            instance-store  

我还成功运行了ec2-authorize default -p 22。

ssh的输出为:

代码语言:javascript
复制
$ ssh -v -i id_rsa-gsg-keypair root@ec2-75-101-249-242.compute-1.amazonaws.com
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config  
debug1: Applying options for *
debug1: Connecting to ec2-75-101-249-242.compute-1.amazonaws.com [75.101.249.242] port 22.
debug1: Connection established.
debug1: identity file id_rsa-gsg-keypair type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc 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
The authenticity of host 'ec2-75-101-249-242.compute-1.amazonaws.com (75.101.249.242)' can't be established.
RSA key fingerprint is d0:ae:58:59:88:b8:58:ae:ab:dc:6f:a0:14:d5:f2:51.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/meh/.ssh/known_hosts).
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
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: id_rsa-gsg-keypair
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

在这里,任何帮助都是非常感谢的。我已经尝试了一百万次,但还是搞不明白到底是怎么回事。

谢谢。

EN

回答 2

Stack Overflow用户

发布于 2011-02-09 23:30:31

您可能会遇到权限错误:

代码语言:javascript
复制
Failed to add the host to the list of known hosts (/home/meh/.ssh/known_hosts)

确保您的用户帐户对文件/home/meh/.ssh/known_hosts具有写入权限

票数 3
EN

Stack Overflow用户

发布于 2013-09-10 20:50:47

此外,您还需要使用用户'ubuntu‘。有关更多详细信息,请参阅pmagunia的文章:

stackoverflow similar question

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4943993

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档