git 从远程仓库 pull 的时候出现以下报错信息:
no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
报错原因为当前使用的命令终端找不到支持的密钥交换方法,因为新版Openssh中认为SHA1这种hash散列算法过于薄弱,已经不再支持,所以我们需要手动去开启对于SHA1的支持
在 Windows 操作系统下的解决方法:
# 在用户的家目录的 .ssh 文件夹下新建文件 config,写入以下内容
Host *
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms +ssh-dss,ssh-rsa
PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa
原创文章,作者:witersen,如若转载,请注明出处:https://www.witersen.com