ssh远程连接报错:WARNING: POSSIBLE DNS SPOOFING DETECTED(已解决)

一、前言

使用ssh连接服务器的时候,一般会填写一个是否信任本地机器的选项

即(yes/no),写了yes就代表着服务器已经信任了你的电脑,以后可以直接链接

因为换了台服务器,之前的内容也都已经迁移过去

但是在连接新的服务器时出现了以下报错

图片版:
在这里插入图片描述

文字版:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The ECDSA
host key for []: has changed, and the key for the
corresponding IP address []: has a different value.
This could either mean that and its host key have changed at the same
time. Offending key for IP in C:\Users\Willi/.ssh/known_hosts:10
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
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
S6:7A. Please contact your system administrator.
Add correct host key in C:\Users\Willi/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in C:\Users\Willi/.ssh/known_hosts:11 ECDSA
host key for []:has changed and you have
requested strict checking. Host key verification failed.

二、定位错误点

找了其他很多方法,也有用root权限的

但是我没有root权限

扫描二维码关注公众号,回复: 14668450 查看本文章

就根据图片中的信息看看,能不能找到错误点在哪

刚巧看到了有一串本地目录

在这里插入图片描述

错误点:

需要添加正确的host key才能连上服务器,并且把之前这个文件夹下的konwn_hosts删掉

在这里插入图片描述

三、解决办法

根据文件描述,找到该文件并删除

重新使用ssh链接服务器

在这里插入图片描述
在重新输入yes之后,就可以连接了

之前的目录下也会重新生成konwn_hosts文件

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41377182/article/details/126845591