【Git】WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED 报错问题解决

1. 出现问题背景

运维迁移代码仓库至其他服务器后,重新 git pull 拉取代码 出现报错
在这里插入图片描述
具体报错内容:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 *********** key sent by the remote host is
SHA256:iT9******************************************fw.
Please contact your system administrator.
Add correct host key in /c/Users/Administrator/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/Administrator/.ssh/known_hosts:2
Host key for ******** has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

2. 解决方案

输入命令:

ssh-keygen -f "/c/Users/Administrator/.ssh/known_hosts" -R 域名(或ip)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/yqyn6/article/details/132295363