【Git】WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED error reporting problem resolution

1. Background of the problem

After operation and maintenance migrates the code warehouse to another server, an error occurs when git pull pulls the code again.
Insert image description here
The specific error content:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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. Solution

input the command:

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

Insert image description here

Guess you like

Origin blog.csdn.net/yqyn6/article/details/132295363