首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Ubuntu-ssh --警告:远程主机标识已更改

Ubuntu-ssh --警告:远程主机标识已更改
EN

Stack Overflow用户
提问于 2011-12-28 17:28:55
回答 4查看 74.7K关注 0票数 64

我无法通过ssh和rysnc连接到远程系统。它不断地给出这个错误消息:

代码语言:javascript
复制
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 RSA key sent by the remote host is
a3:8f:7c:07:c9:12:d8:aa:cd:c2:ba:b3:27:68:bc:c2.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:8
RSA host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]

我已经从/home/user/.ssh中删除了authorized_keys文件。

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2011-12-28 17:34:32

消息上写的是"/root/.ssh/known_hosts“而不是authorized_keys。从该文件中删除该文件(或至少相应的密钥),然后可以再次执行操作!但请注意:密钥更改肯定是有原因的。系统是否重新安装?请确保检查这一点,否则ssh的整个概念都是无效的。

顺便说一句,你以root身份ssh有什么原因吗?

票数 73
EN

Stack Overflow用户

发布于 2012-11-27 18:46:38

使用以下命令从.ssh/known_hosts文件中删除旧密钥

代码语言:javascript
复制
ssh-keygen -R <host>
票数 128
EN

Stack Overflow用户

发布于 2015-02-11 18:31:16

您可以使用sed从known_hosts文件中删除8行的有问题的键:

代码语言:javascript
复制
sed -i -e 8d /root/.ssh/known_hosts
票数 12
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8654064

复制
相关文章

相似问题

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