新建的虚机在ssh连接时提示Host key verification failed.
新建的虚拟机,自动分配的ip为之前删除的虚拟机,在连接新创建的虚拟机时,报错如下:[centos@svnserver ~]$ ssh -i ssh-key.ssh-keycentos@10.10.10.45@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WARNING: REMOTE HOST IDENTIFIC...
·
新建的虚拟机,自动分配的ip为之前删除的虚拟机,在连接新创建的虚拟机时,报错如下:
[centos@svnserver ~]$ ssh -i ssh-key.ssh-key centos@10.10.10.45
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
SHA256:【*********】
Please contact your system administrator.
Add correct host key in /home/centos/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/centos/.ssh/known_hosts:2
ECDSA host key for 【IPAddress】 has changed and you have requested strict checking.
Host key verification failed.
原因:
因为新创建的虚拟机的ssh信息 和本地机的ssh信息对不上,因此更新本地机的ssh缓存信息即可
执行:
ssh-keygen -R 【IPAddress】
得到:
# Host 【IPAddress】 found: line 2
/home/centos/.ssh/known_hosts updated.
Original contents retained as /home/centos/.ssh/known_hosts.old
解决该问题
更多推荐
已为社区贡献1条内容
所有评论(0)