集群机器使用sshd-keygen配置了免密登录,然而登陆报错

ERROR: Someone could be eavesdropping on
you right now (man-in-the-middle attack)!
ERROR: It is also possible that a host key
has just been changed.
ERROR: The fingerprint for the ECDSA key
sent by the remote host is
ERROR:
SHA256:iahvdc8nbruyVwa2Uds531bFLbdAbtX+VTf8QHX9G2U.
ERROR: Please contact your system
administrator.
ERROR: Add correct host key in /root/.ssh/known_hosts
to get rid of this message.
ERROR: Offending ECDSA key in
/root/.ssh/known_hosts:3
ERROR: ECDSA host key for 172.20.10.6 has
changed and you have requested strict checking.
ERROR: Host key verification failed.

这是远程key失效导致,主控机更新了id_rsa公私钥,但是缓存中还是旧的,需要清理一下对应的缓存

ssh-keygen -R x.x.x.x(远端ip)

再重新更新id_rsa.pub到远端,即可

ssh-copy-id -i ~/.ssh/id_rsa.pub x.x.x.x