拉起项目代码报错
git clone ssh://uidxxx@gerrit-xxxxxxxx
Cloning into ‘xxxxx’…
Unable to negotiate with xxx.xx.xxx.ip port xxxxx: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
//无法读取远程仓库
未找到匹配的密钥交换方法,不同的密码交换方法
diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
解决方法
git config配置文件中添加以下内容
uidxxx-MINGW64 vim ~/.ssh/config ```vim
Host *
PubkeyAcceptedKeyTypes +ssh-rsa
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha
uidxxx-MINGW64 ~/.ssh
$ ls -l
total 10
-rw-r--r-- 1 uidxxx 1049089 117 Aug 15 17:00 config
-rw-r--r-- 1 uidxxx 1049089 2602 Aug 15 16:44 id_rsa
-rw-r--r-- 1 uidxxx 1049089 572 Aug 15 16:44 id_rsa.pub
-rw-r--r-- 1 uidxxx 1049089 1007 Aug 15 21:18 known_hostsuidxxx-MINGW64 ~/.ssh
$ cat config
Host *
PubkeyAcceptedKeyTypes +ssh-rsa
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1uidxxx-MINGW64 ~/.ssh
git又能愉快的玩耍了