一、問題描述
SSH鏈接git上傳代碼,之前一直可以,但是當(dāng)前報(bào)錯(cuò):
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
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:****....jQXVUpKZIDTMczCvj3tD2s. Please contact your system administrator. Add correct host key in /c/Users/...02/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/...02/.ssh/known_hosts:1 RSA host key for github.com has changed and you have requested strict checking. Host key verification failed.
Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
二、問題原因
用OpenSSH的時(shí)候會(huì)將每個(gè)你訪問過計(jì)算機(jī)的公鑰(public key)都記錄在/.ssh/known_hosts。當(dāng)下次訪問相同計(jì)算機(jī)時(shí),OpenSSH會(huì)核對(duì)公鑰。如果公鑰不同,OpenSSH會(huì)發(fā)出警告,信息報(bào)錯(cuò)類似錯(cuò)誤,如當(dāng)前情況。
所以當(dāng)前就是git的的公鑰有變化,正如報(bào)錯(cuò)信息上寫的。
三、解決方法
如下步驟
1.第一步:觀察報(bào)錯(cuò)信息,定位是.ssh/known_hosts 文件的第幾行出現(xiàn)的問題。
如當(dāng)前報(bào)錯(cuò)指定第1行,github.com相關(guān)的。
2.第二步:刪除.ssh/known_hosts的指定行,保留其他信息
刪除后保存,然后重新傳輸?shù)絞it,成功。文章來源:http://www.zghlxwxcb.cn/news/detail-727386.html
3.注意建議操作前備份
建議提前先備份一下信息,免得到操作失誤,還是可以恢復(fù)。文章來源地址http://www.zghlxwxcb.cn/news/detail-727386.html
到了這里,關(guān)于ssh鏈接報(bào)錯(cuò):IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!