300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > git拉取代码报错:Unable to negotiate with xxx port xxx: no matching host key type found

git拉取代码报错:Unable to negotiate with xxx port xxx: no matching host key type found

时间:2022-02-11 06:11:37

相关推荐

git拉取代码报错:Unable to negotiate with xxx port xxx: no matching host key type found

git拉取代码报错:

Unable to negotiate with 172.18.19.44 port 22: no matching host key type found. Their offer: ssh-rsafatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

SSH有几种不同类型的密钥:RSA密钥 (ssh-rsa) 可以支持多种签名。签名类型sssh-rsa是指带有SHA-1的RSA,而签名类型rsa-sha2-256是带有SHA-256的RSA,rsa-sha2-512是带有SHA-512的RSA。

上面报错中提示,git服务端中使用的密钥是ssh-rsa类型的,而我本地的ssh(openSSH 9.x)默认不支持这种算法,需要指定下算法

解决方案:

进入~/.ssh目录,打开config文件(没有的话新建一个),添加如下配置:

Host {域名}User gitPubkeyAcceptedAlgorithms +ssh-rsaHostkeyAlgorithms +ssh-rsa

{域名}替换成你自己的git服务器域名

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。