主机密钥validation失败

所以我试图通过我的PC与Cygwin ssh到我的UBUNTU上。 我可以顺利WINSCP,但是当我通过命令行ssh出现这个错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 5d:84:de:4e:a8:81:df:22:06:23:98:34:cd:26:f5:1a. Please contact your system administrator. Add correct host key in /home/Trevor/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/DIRECTORY ECDSA host key for HOSTNAME has changed and you have requested strict checking. Host key verification failed. 

所以我查了一下,它说,我需要更改我的host key文件夹位于我的home文件夹中的.ssh文件夹。 那么,没有一个,所以我做了一个。 再次尝试,并得到同样的错误。

谁能告诉我该怎么办? 非常感谢先进的!

“主机密钥验证失败”表示远程主机的主机密钥已更改。

Ssh将远程主机的主机密钥存储在〜/ .ssh / known_hosts中。 您可以手动编辑该文本文件并删除旧密钥(您可以在错误消息中看到行号),也可以使用

 ssh-keygen -R hostname 

尝试

  rm -f /home/user/.ssh/known_hosts 

或从known_hosts中删除有问题的密钥

 ssh-keygen -R hostname 

所以看起来像你的Ubuntu主机密钥已经改变,因为你上次从Cygwin ssh到它。

该消息已经告诉你该怎么做,

 cd /home/Trevor.ssh open know_hosts file and delete the old key of your ubunto box once the key is removed, ssh to your ubuntu box again