日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Git服务器报错:host key for (ip地址) has changed and you have requested strict checking

發布時間:2023/12/10 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Git服务器报错:host key for (ip地址) has changed and you have requested strict checking 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一:報錯提示

如下:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ ? ?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 ECDSA key sent by the remote host is
85:82:b1:58:20:21:a5:da:be:24:e8:14:9a:12:b2:d2.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
? remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R xxx.xxx.xxx.xxx (服務器ip地址)
ECDSA host key for xxx.xxx.xxx.xxx (服務器ip地址) has changed and you have requested strict checking.
Host key verification failed.
fatal: The remote end hung up unexpectedly

二:原因

ssh會把你每個你訪問過計算機的公鑰(public key)都記錄在~/.ssh/known_hosts。當下次訪問相同計算機時,OpenSSH會核對公鑰。如果公鑰不同,OpenSSH會發出警告。

原因是我的GitLab服務器重裝了系統(清除了與我本地SSH連接協議相關信息),本地的SSH協議信息便失效了。SSH連接相同的ip地址時因有連接記錄直接使用失效的協議信息去驗證該ip服務器,所以會報錯,使用上述命令便可以清除known_hosts里舊緩存文件。

三:解決方法

刪除xxx.xxx.xxx.xxx (服務器ip地址)的相關rsa的信息即可

在本地機輸入一下命令行:

ssh-keygen -R xxx.xxx.xxx.xxx (服務器ip地址)

?

接著git拉取代碼,成功

總結

以上是生活随笔為你收集整理的Git服务器报错:host key for (ip地址) has changed and you have requested strict checking的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。