今天连接阿里云服务,发现连接失败(好久没用了,今天又捡起来了😂) 

现象

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
2c:d0:17:8a:82:4c:23:d6:14:be:d0:1d:88:8b:8b:03 [MD5].
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
You can use following command to remove all keys for this IP:
ssh-keygen -R fanhana-0002 -f /root/.ssh/known_hosts
RSA host key for fanhana-0002 has changed and you have requested strict checking.
Host key verification failed.

原因:

由于我换了系统,由alibaba cloud Linux3换成centos7系统。

当然还有其他的原因。

跳转到的目标云服务器上的OpenSSH被重装了、IP地址或主机名称发生变化,或其他原因,导致跳转失败。

处理方法

通过删除本端的“known_hosts”文件,解决此问题。

  1. 在本云服务器上,以“root”用户,进入到命令行界面。
  2. 删除“known_hosts”文件。

    rm ~/.ssh/known_hosts

或者更新

vim ~/.ssh/known_hosts

删除失效的host

OK

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐