scp报错:Host key verification failed

问题:

scp时候报错Host key verification failed,详细报错信息:

C:\Users\xxx>scp -r root@198.18.36.1:/mnt/logfs/ D:\Users\xxx\Desktop\tmp\
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:U7RXf2Vk2cd1Z99jqt04innfoD78VJukI+aGjgEmsq4.
Please contact your system administrator.
Add correct host key in C:\\Users\\xxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\\Users\\xxx/.ssh/known_hosts:21
RSA host key for 198.18.36.1 has changed and you have requested strict checking.
Host key verification failed.

解决办法:

执行命令:ssh-keygen -R 198.18.36.1

然后重新scp即可

如果对您有帮助的话动手点个赞哦!