在克隆阿里云代碼時報了下方的錯
Unable to negotiate with 47.98.49.44 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.
在網(wǎng)上搜一波都是讓生成ssh公鑰然后部署到服務(wù)器上,然后折騰一晚上,以為就是這個問題,但還是不行。
后來發(fā)現(xiàn)原來是當(dāng)時本來本地已經(jīng)有生成過公鑰了,但我怕重復(fù),所以刪掉了以前的,還連著刪了幾個其他文件,無語!
原因可能是新的ssh客戶端不支持ssh-rsa算法,要修改本地配置重新使用ssh-rsa算法。
解決方法:
在生成公鑰的文件夾里(一般在當(dāng)前用戶目錄下的.ssh文件中)創(chuàng)建一個config文件(沒有后綴),用文本文檔格式打開,添加下方內(nèi)容
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
?
保存文章來源:http://www.zghlxwxcb.cn/news/detail-522978.html
然后再試克隆倉庫,成了!文章來源地址http://www.zghlxwxcb.cn/news/detail-522978.html
到了這里,關(guān)于[已解決]使用git拉代碼時報錯: Unable to negotiate with **** port 22: no matching host key type found.的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!