今天遇到了一个错误内容:

RSA host key for x.x.x.x has changed and you have requested strict checking.
Host key verification failed.

具体类似下面:

[root@kvm_salt_zabbix gitlab]# ssh-copy-id -i   /root/.ssh/id_rsa.pub   root@47.52.x.x
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
xxxxxxx.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for x.x.x.x has changed and you have requested strict checking.
Host key verification failed.

原因目标服务器重装以后,key发生变化。


ssh-keygen -R 目标服务器IP或网址    执行完命令以后重新添加。

输入上面的host key for x.x.x.x 地方的Ip或者域名。