【发布时间】:2016-08-05 15:46:42
【问题描述】:
我已经启动了一个 gerrit 服务器。当我尝试 ssh 到它时,我得到:
Unable to negotiate with 127.0.0.1 port 29418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
由于已弃用,因此需要手动启用 (http://www.openssh.com/legacy.html):
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 username@localhost -p 29418
这很好用。现在我想git clone,但需要通过 git 将KexAlgorithms 选项传递给 ssh。一种解决方案是add the option to ~/.ssh/config。这是我添加的:
Host localhost
KeyAlgorithms +diffie-hellman-group1-sha1
问题是我收到以下错误:
/home/username/.ssh/config: line 6: Bad configuration option: keyalgorithms
有一个 HostKeyAlgorithms 选项在那里工作,但抱怨 Bad key types '+diffie-hellman-group1-sha1'。如何配置git/ssh连接gerrit?
【问题讨论】:
-
标题说它在抱怨“KexAlgorithms”。在帖子中,您说您添加了“HostKeyAlgorithms”,并且它在抱怨“keyalgorithms”。也许您可以澄清一下配置文件第 6 行的内容,以及它实际抱怨的内容。
-
@Kenster 谢谢,这就是问题所在,即使在弄乱了半小时后我仍然没有看到它。已更新以使其保持一致。考虑到这纯粹是一个错字问题,现在不确定这篇文章是否具有建设性。很高兴删除。