git pull 时报错:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

git pull 时报错:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

problem

具体报错信息:
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:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/user/.ssh/known_hosts:5
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: 无法读取远程仓库。
请确认您有正确的访问权限并且仓库存在。

reason

善不清楚

solution

根据提示
Offending RSA key in /Users/user/.ssh/known_hosts:5
打开 这个文件,并删除第5行
sudo vi /Users/user/.ssh/known_hosts

再次重新 git pull,ssh 会重新记录信息,输入yes即可

你可能感兴趣的:(pits,git,github,linux)