SSH连接远程机器报错:Host key verification failed.

发布时间 2023-05-06 15:02:05作者: 腹肌猿
C:\Users\xxx>ssh root@10.239.168.39
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
SHA256:Vlrl2MRlgUIabY2IgyP4OUm79938tPNVyhw92wz3Guc.
Please contact your system administrator.
Add correct host key in C:\\Users\\xxx/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\xxx/.ssh/known_hosts:1
RSA host key for 10.239.168.39 has changed and you have requested strict checking.
Host key verification failed.

 

网上查了各种方法,都不太管用

找到报错提示的 C:\\Users\\xxx/.ssh/known_hosts 文件,找到里边现在ip对应的那一行删掉,下次SSH连接时重新生成key,这样一来问题就解决了