今天本地git訪問github倉庫的時候出現(xiàn)如下異常:
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會把每個曾經(jīng)訪問過的Git服務器的公鑰記錄在/Users/xx/.ssh/known_hosts文件中,當下次訪問時會核對公鑰,如果和上次的記錄不同,SSH就會發(fā)出警告。
解決方法:直接刪除/Users/xx/.ssh/known_hosts文件。文章來源:http://www.zghlxwxcb.cn/news/detail-626950.html
GitHub地址:https://github.com/mingyang66/spring-parent文章來源地址http://www.zghlxwxcb.cn/news/detail-626950.html
到了這里,關于解鎖新技能《Git本地訪問GitHub出現(xiàn)WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!警告》的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!