今天本地git访问github仓库的时候出现如下异常:
xx:spring-xx xx$ git push
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:uNiVztksCsDhcc0u9e8BujQXxxUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/xx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/xx/.ssh/known_hosts:2
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
问题原因是SSH会把每个曾经访问过的Git服务器的公钥记录在/Users/xx/.ssh/known_hosts文件中,当下次访问时会核对公钥,如果和上次的记录不同,SSH就会发出警告。
解决方法:直接删除/Users/xx/.ssh/known_hosts文件。文章来源:https://www.toymoban.com/news/detail-626950.html
GitHub地址:https://github.com/mingyang66/spring-parent文章来源地址https://www.toymoban.com/news/detail-626950.html
到了这里,关于解锁新技能《Git本地访问GitHub出现WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!警告》的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!