(阅读时间30S)

这一类问题,一般都是你的known_hosts保存了网络身份验证证书,更换了环境去访问,就会被服务器拒绝。

按照错误提示的/c/Users/HASEE/.ssh/known_hosts,打开这个文件,把你访问的远程服务器的ip地址修改下即可。

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
SHA256:6ZDmazf+l+8cMDYOgXkKHKya0qM/09yjaDzq4FErkKE.
Please contact your system administrator.
Add correct host key in /c/Users/HASEE/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/HASEE/.ssh/known_hosts:10
ECDSA host key for 10.70.59.252 has changed and you have requested strict checking.
Host key verification failed.

具体来说,打开方式就是

vim /c/Users/HASEE/.ssh/known_hosts

然后切换成insert模式进行修改

删除这个ip地址例如10.50.90.23 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAxxxxxxxxxxxxxxx

后面对应的一大堆就是证书,把这一行都删除,包括ip地址。


再次访问,可以认为是首次访问

The authenticity of host '10.70.59.252 (10.70.59.252)' can't be established.
ECDSA key fingerprint is SHA256:6ZDmazf+l+8cMDYOgXkKHKya0qM/09yjaDzq4FErkKE.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
 

你会发现known_hosts里面有个新的key

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐