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

[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的正确答案在这里。


当前回答

对我有用!

错误:错误的RSA密钥在/var/lib/ss /pubconf/known_hosts:4

这表明您在行号处有一个违规的RSA密钥。4

解决方案1:

1. vi /var/lib/sss/pubconf/known_hosts 2. 删除行号:4。 3.保存并退出,然后重试。

解决方案2:

ssh-keygen -R "你的服务器主机名或ip"

OR

解决方案3:

Sed -i '4d' /root/.ssh/known_hosts

这将删除/root/的第4行。Ssh /known_hosts in place(-i)。

其他回答

我的UBUNTU (linux)解决方案:

1.你必须删除known_hosts文件中的内容,该文件位于/home/YOUR_USERNAME/.ssh/known_hosts

2.生成一个新的ssh密钥,如"ssh-keygen -t rsa -C "your.email@example.com" -b 4096"

3.复制粘贴您的新的ssh密钥到您的git存储库(在我的情况下是gitlab) ssh密钥。

这对我很管用!

我的解决方案是:

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

这比删除所有known_hosts要好

正如许多人已经说过的,使用ssh-keygen,即。

ssh-keygen -R pong

另外,你可以考虑暂时关闭主机按键检查:

ssh -oStrictHostKeyChecking=no root@pong

我在Windows 10中使用PowerShell进行ssh。 我的问题在Windows目录:C:\Users\youruser\.ssh 删除该目录中的known_hosts文件以忘记旧值。

您也可以使用文件资源管理器来定位和删除文件。

只需清除/home/{username}/.ssh/known_hosts目录下的known_hosts即可

vi /home/{username}/.ssh/known_hosts 

删除已知主机内的每一行并退出,之后您将能够登录。

OR

执行此命令

ssh-keygen -R "hostname/ip_address"