git提交代碼時報錯:
git 報錯
Unable to negotiate with 106.52.160.162 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
原因:
是Git找不到支持的密鑰交換方法,因為新版Openssh中認為SHA1這種hash散列算法過于薄弱,已經不再支持,所以需要手動去允許對于SHA1的支持 。
解決辦法:
1、MacOS、Linux,在生成公鑰的~/.ssh文件夾下,新建一個config文件(config文件沒有后綴)。
2、Windows 文件夾在當前用戶下 ~/.ssh(如下圖所示)比如我的用戶目錄
?config文件是添加代碼:文章來源:http://www.zghlxwxcb.cn/news/detail-513166.html
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
保存,然后重新提交代碼,成功。文章來源地址http://www.zghlxwxcb.cn/news/detail-513166.html
到了這里,關于git 報錯 Unable to negotiate with 106.52.160.162 port 22: no matching host key type found.的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!