git clone 报错Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

时间:2022-10-25 23:07:06

在执行git clone命令报错

Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

Unable to negotiate with xxx.xxx.xxx.xxx port : no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

解决:

# export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'

这种方法每次新开git窗口,都需要重新输入export GIT_SSH_COMMAND

避免的方式就是打开.bashrc文件,在终端输入:$ vim ~/.bashrc  ,然后向.bashrc文件写入

export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'

完毕