Unable to negotiate with 192.168.XX.XX port XXXX: no matching key exchange method found.

问题

Unable to negotiate with xx.xx.xx.xxx port 29418: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: 无法读取远程仓库。


解决方法

sudo vim ~/.ssh/config

添加:

1 host xx.xx.xx.xxx
2 port 29418
3 KexAlgorithms +diffie-hellman-group1-sha1
4 KexAlgorithms +diffie-hellman-group14-sha1

原因:

如果是fetch github这些平台的代码可以直接拉,但是如果是拉取自己搭建的git服务器代码就需要配置一下 .ssh/config,添加一下端口和相应信息

posted @ 2021-11-29 09:22  年华似水゛  阅读(1970)  评论(0)    收藏  举报