【发布时间】:2021-09-17 14:25:06
【问题描述】:
我正在尝试克隆 git 存储库,但出现错误
Unable to negotiate with <server>: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
我编辑了~/.ssh/config并添加了
Host somehost.example.org
KexAlgorithms +diffie-hellman-group1-sha1"
但我仍然遇到同样的错误。
其他解决方案是使用命令ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@127.0.0.1 -p 2222,但我也收到拒绝与端口号 22 的连接。
我用的是windows机器。
【问题讨论】:
-
您是否按照help.github.com/articles/set-up-git 中的所有步骤进行操作?我相信您已经遗漏了一两件事,导致了这个问题。
-
你能分享你使用的命令吗?
-
在
.ssh/config/中,您没有用双引号 (") 将条目括起来,对吧? -
如果你有ssh-agent在后台运行,你必须在编辑
~/.ssh/config后重启它(在任务管理器中搜索ssh-agent.exe)。在将 Git for Windows 升级到 v2.25.1 后,这对我有用。