-
拉取代碼時(shí)報(bào)錯(cuò):
# Mac 報(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 ED25519 key sent by the remote host is SHA256:88E6751+dflNKvWOxzg2/98Vfg+P4ZWErIR7iTckhBM. Please contact your system administrator. # 注意這里:/Users/xxx/.ssh/known_hosts known_hosts的路徑 Add correct host key in /Users/xxx/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /Users/xxx/.ssh/known_hosts:2 Host key for gitlab.hapi123.net has changed and you have requested strict checking. Host key verification failed. 致命錯(cuò)誤:無法讀取遠(yuǎn)程倉庫。 請確認(rèn)您有正確的訪問權(quán)限并且倉庫存在。
# windows 報(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 ED25519 key sent by the remote host is SHA256:KuBLGFm/xkm0bpWVSGzQaT1Qqekl74Ui8TWnmtrEwpU. Please contact your system administrator. # 注意這里:/c/Users/xxx/.ssh/known_hosts known_hosts的路徑 Add correct host key in /c/Users/xxx/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /c/Users/xxx/.ssh/known_hosts:3 Host key for gitlab.hapi123.net 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
-
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
翻譯過來就是:警告:遠(yuǎn)程主機(jī)標(biāo)識已更改!
此報(bào)錯(cuò)是由于遠(yuǎn)程的主機(jī)的公鑰發(fā)生了變化導(dǎo)致的。
ssh
服務(wù)是通過公鑰和私鑰來進(jìn)行連接的,它會(huì)把每個(gè)曾經(jīng)訪問過計(jì)算機(jī)或服務(wù)器的公鑰(public key
),記錄在~/.ssh/known_hosts
中,當(dāng)下次訪問曾經(jīng)訪問過的計(jì)算機(jī)或服務(wù)器時(shí),ssh
就會(huì)核對公鑰,如果和上次記錄的不同,OpenSSH
會(huì)發(fā)出警告。當(dāng)兩個(gè)設(shè)備第一次進(jìn)行鏈接時(shí),會(huì)在
~/.ssh/konwn_hosts
中將被連接設(shè)備的公鑰信息進(jìn)行保存,后續(xù)再次鏈接時(shí)OpenSSH
會(huì)核對公鑰來進(jìn)行一個(gè)簡單的驗(yàn)證 -
【解決方法】找到報(bào)錯(cuò)中
known_hosts
的路徑,進(jìn)入該目錄,刪除掉known_hosts
、known_hosts.old
文件,然后重新執(zhí)行之前報(bào)錯(cuò)的命令,應(yīng)該會(huì)提示是否確定授權(quán),輸入yes
就行了。文章來源:http://www.zghlxwxcb.cn/news/detail-679827.html另外需要注意線上對應(yīng)的公鑰確實(shí)是你本機(jī)的
rsa
公鑰。文章來源地址http://www.zghlxwxcb.cn/news/detail-679827.html# 進(jìn)入目錄(這個(gè)路徑在上面的報(bào)錯(cuò)中有體現(xiàn),有注釋標(biāo)記) $ cd /Users/xxx/.ssh # 移除文件 $ sudo rm -rf known_hosts known_hosts.old # 然后再次執(zhí)行報(bào)錯(cuò)的命令
到了這里,關(guān)于完美解決 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!