我重新安装了我的服务器,我收到这些消息:

[user@hostname ~]$ ssh root@pong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
6e:45:f9:a8:af:38:3d:a1:a5:c7:76:1d:02:f8:77:00.
Please contact your system administrator.
Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/lib/sss/pubconf/known_hosts:4
RSA host key for pong has changed and you have requested strict checking.
Host key verification failed.

我尝试了在网上找到的各种解决方案。我的known_hosts文件(通常在~/.ssh/known_hosts中)在/var/lib/ss /pubconf/known_hosts中。我试图编辑它,但它仍然是一个状态。我已经安装了ipa-client和Fedora 19。如何解决此警告?

到目前为止回答的所有答案都只适用于没有安装Freeipa的情况。

下面adrin的评论中关于freeipa的正确答案在这里。


当前回答

这里的其他答案都很好,不管怎样,我通过删除~/.ssh/known_hosts解决了这个问题。这当然可以解决问题,但可能不是最好的方法。

其他回答

这是因为您的远程计算机设置已更改。为此删除当前的键。

vim /root/.ssh/known_hosts

删除正在连接的IP所在的线路。

编辑/home/hostname /。Ssh /known_hosts,删除4行,保存。

然后再次运行ssh root@pong,您将看到如下消息:您确定要继续连接(yes/no)吗?是的,打印出来就行了。

注意:如果你遇到一些问题,先阅读提示,它会有帮助。

只做:

cd /home/user/.Ssh / ->这里user将是您的用户名,例如/home/jon/。

然后

Gedit known_hosts &并删除其中的内容。

现在再次使用ssh,它应该可以工作。

这里有一个最简单的解决方案:

ssh-keygen -R <host>

例如,

ssh-keygen -R 192.168.3.10

从ssh-keygen手册页:

-R hostname从known_hosts文件中删除属于hostname的所有密钥。此选项用于删除散列主机(请参阅上面的-H选项)。

我的解决方案是:

六世~ / . ssh / known_hosts 删除包含你想要连接的ip的行。

这比删除所有known_hosts要好