Unable to negotiate with xx.xx.xx.xx port xxxx: no marching host key type found. ~~

最近在拉公司自己搭建的git服务器上的代码时报错:

Unable to negotiable with xx.xx.xx.xx port xxxx: no matching host key type found. Their offer : diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

这是因为客户端与服务器支持的密钥交换方法不一致导致的,需要在本地配置一下。

进入 .ssh/ 文件,创建一个config文件写上:

Host *
KexAlgorithms +diffie-hellman-group1-sha1
ServerAliveInterval 10
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

我查找的大多数都只让写 KexAlgorithms +diffie-hellman-group1-sha1 我配置完又提示ssh-rsa 相关的,所以又加了ssh-rsa的。

你可能感兴趣的:(Unable to negotiate with xx.xx.xx.xx port xxxx: no marching host key type found. ~~)