問題描述
代碼倉庫已經添加了ssh公鑰之后,克隆代碼到本地時就報了這個問題
執(zhí)行命令 git clone git@xxxxxxxxxxxxx.git
不能正常clone代碼,報錯信息如下:
Unable to negotiate with xxxxxxx port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
如圖所示:
解決方案:
首先是找到git安裝目錄(根據自己安裝時選項,找到這個目錄)
然后進入 etc目錄,找到ssh目錄
再進入ssh目錄,找到 ssh_config 配置文件
打開ssh_config此文件,滑動到最下面,新增自己git主機地址(這里我直接默認*)
直接復制下面這一段到文件中最底部位置即可
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
配置完成后,保存配置文件后再次去clone代碼文章來源:http://www.zghlxwxcb.cn/news/detail-444037.html
終于可以克隆下來了。。。文章來源地址http://www.zghlxwxcb.cn/news/detail-444037.html
到了這里,關于Unable to negotiate with XXXX port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!