首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >主机密钥验证失败-亚马逊EC2

主机密钥验证失败-亚马逊EC2
EN

Stack Overflow用户
提问于 2015-03-18 01:15:56
回答 4查看 13.1K关注 0票数 11

我正在使用win7和git bash以及一个亚马逊EC2实例。我尝试登录我的实例:

代码语言:javascript
运行
复制
$ ssh -i f:mykey.pem ubuntu@ec2-52-10-**-**.us-west-2.compute.amazonaws.com
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
 It is also possible that a host key has just been changed.
 The fingerprint for the ECDSA key sent by the remote host is
 71:00:d7:d8:a------------------26.
 Please contact your system administrator.
 Add correct host key in /m/.ssh/known_hosts to get rid of this message.
 Offending ECDSA key in /m/.ssh/known_hosts:27
 ECDSA host key for ec2-52-10-**-**.us-west-2.compute.amazonaws.com has changed and you have request
 ed strict checking.
 Host key verification failed.

以前以这种方式登录工作得很好,但这个问题是在我重启EC2实例后出现的。我怎么才能让它再次工作呢?

编辑:

代码语言:javascript
运行
复制
$ ssh -i f:tproxy.pem ubuntu@ec2-52-10-**-**.us-west-2.compute.amazonaws.com
ssh: connect to host ec2-52-10-**-**.us-west-2.compute.amazonaws.com port 22: Bad file number

重试:

代码语言:javascript
运行
复制
The authenticity of host 'ec2-52-10-**-**.us-west-2.compute.amazonaws.com (52.10.**-**)' can't be
established.
ECDSA key fingerprint is d6:c4:88:-----------fd:65.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'ec2-52-10-**-**.us-west-2.compute.amazonaws.com,52.10.**-**' (ECDSA) t
o the list of known hosts.
Permission denied (publickey).

我现在该怎么做?

EN

Stack Overflow用户

发布于 2020-07-31 06:04:02

键入以下命令以设置权限。将~/mykeypair.pem替换为密钥对私钥文件的位置和文件名。

chmod 400 ~/mykeypair.pem

在您的示例中,mykeypair.pem是tproxy.pem

我也面临着同样的问题,在把pem文件设为私有文件之后,这个问题就解决了。

以下是有关SSH Key Permissions的更多信息

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

https://stackoverflow.com/questions/29105552

复制
相关文章

相似问题

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