【问题标题】:ssh - Bad configuration option: KeyAlgorithms [closed]ssh - 错误的配置选项:KeyAlgorithms [关闭]
【发布时间】: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 谢谢,这就是问题所在,即使在弄乱了半小时后我仍然没有看到它。已更新以使其保持一致。考虑到这纯粹是一个错字问题,现在不确定这篇文章是否具有建设性。很高兴删除。

标签: git ssh gerrit


【解决方案1】:

您在配置中放置的选项与在命令行中放置的选项不同。应该是

Host localhost
    KexAlgorithms +diffie-hellman-group1-sha1

KexAlgorithms 不是HostKeyAlgorithms。它们是完全不同的选项,具有不同的价值,用于不同的目的。

【讨论】:

  • 那太尴尬了!当您回复时,我再次阅读了我的帖子,起初我很震惊我写的是Kex而不是Key,但事实证明它实际上应该是KexAlgorithms
  • 我在你的答案中得到了同样的错误代码。
  • @TomášZato 你能澄清一下吗?
猜你喜欢
  • 2013-04-13
  • 2018-05-07
  • 1970-01-01
  • 1970-01-01
  • 2021-11-11
  • 2021-10-30
  • 2020-08-01
  • 2016-09-12
  • 1970-01-01
相关资源
最近更新 更多