【问题标题】:Unable to negotiate a key exchange method with Mina deployment无法与 Mina 部署协商密钥交换方法
【发布时间】:2015-10-29 09:41:39
【问题描述】:

我在使用 Mina 部署时遇到这样的消息,但不确定为什么 Git 无法提取 repo。

由于Unable to negotiate a key exchange method 消息,我尝试切换 sshd_config,但仍然无法解决问题。感谢您的帮助。

   -----> Creating a temporary build path
          $ touch "deploy.lock"
          $ mkdir -p "$build_path"
          $ cd "$build_path"

   -----> Cloning the Git repository
          $ git clone "git@github.com:repo/project.git" "/home/deploy/project/scm" --bare
          Cloning into bare repository '/home/deploy/project/scm'...
          Unable to negotiate a key exchange method
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.
    !     ERROR: Deploy failed.

   -----> Cleaning up build
          $ rm -rf "$build_path"
          Unlinking current
          $ rm -f "deploy.lock"
          OK

    !     Command failed.
          Failed with status 1 (19)

【问题讨论】:

    标签: ruby-on-rails git ubuntu deployment ssh


    【解决方案1】:

    问题是,您的本地 SSH 客户端和 GitHub 上的远程端点无法就通用密钥交换方法达成一致。

    这主要发生在您使用一组可用的密钥交换方法时,或者您使用的是非常旧且过时的 SSH 客户端,它不支持任何仍被认为是安全的方法。

    有趣的是,这只发生在一些 GitHub Repos:我仍然能够从其他报告中提取。

    要进行诊断,您可以设置以下环境变量以查看更多 SSH 输出:

    export GIT_SSH_COMMAND="ssh -vv"
    

    为了解决这个问题,我在 config_ssh~/.ssh/.config 中添加了一个自定义条目,允许该主机使用更多旧算法。请注意,这应该出现在任何Host * 部分的上方

    # Github needs diffie-hellman-group-exchange-sha1 some of the 
    # time but not always.
    Host github.com
        KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-03
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      相关资源
      最近更新 更多