虚拟机迁移时出现密钥不对的问题

By | 2023-08-17
迁移虚拟机时报错:
ask started by HA resource agent
2021-08-17 00:35:20 # /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=H1-vps19' [email protected] /bin/true
2021-08-17 00:35:20 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2021-08-17 00:35:20 @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
2021-08-17 00:35:20 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2021-08-17 00:35:20 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
2021-08-17 00:35:20 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
2021-08-17 00:35:20 It is also possible that a host key has just been changed.
2021-08-17 00:35:20 The fingerprint for the RSA key sent by the remote host is
2021-08-17 00:35:20 SHA256:HGJz543rfdKAS437bBKQPkKJSLAJLepL5IFFFF93KFec.
2021-08-17 00:35:20 Please contact your system administrator.
2021-08-17 00:35:20 Add correct host key in /root/.ssh/known_hosts to get rid of this message.
2021-08-17 00:35:20 Offending RSA key in /etc/ssh/ssh_known_hosts:1
2021-08-17 00:35:20 remove with:
2021-08-17 00:35:20 ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "H1-vps19"
2021-08-17 00:35:20 Host key for H1-vps19 has changed and you have requested strict checking.
2021-08-17 00:35:20 Host key verification failed.
2021-08-17 00:35:20 ERROR: migration aborted (duration 00:00:01): Can't connect to destination address using public key
TASK ERROR: migration aborted
在需要迁移VM的节点主机上操作:
ssh -o 'HostKeyAlias=<Target node Name>' root@<Target node IP>

按实际情况更改为迁移目标节点的信息:

ssh -o 'HostKeyAlias=H2-vps02' [email protected]

如果出现以下提示:

root@H1-vps19:~# ssh -o 'HostKeyAlias=H2-vps02' [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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:HGFz17oiODFDFDS437bBKLFDKLEGfepL5IFFbDdWkec.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /etc/ssh/ssh_known_hosts:1
  remove with:
  ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "H2-vps02"
Host key for H2-vps02 has changed and you have requested strict checking.
Host key verification failed.
那按上面执行:ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "H2-vps02"

然后再次执行: ssh -o 'HostKeyAlias=H2-vps02' [email protected]

 

發佈留言