Unable to negotiate a key exchange method with Mina deployment

寵の児 提交于 2019-12-24 11:47:49

问题


I'm encountering a message like this while deploying with Mina, but not sure why Git is not able to pull the repo.

I've tried switching sshd_config due to Unable to negotiate a key exchange method message, but still can't figure things out. Thanks for helping.

   -----> 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)

回答1:


The issue is, that your local SSH client and the remote endpoint at GitHub are unable to agree on a common key exchange method.

This will mostly occur when you poked around with the set of available Key exchange methods or you are using a very old & outdated SSH client which does not support any method which is still regarded as safe.

Interestingly this only occurs on some GitHub Repos: I'm still able to pull from other reports.

To diagnose you can set the following environment variable to see more of the SSH output:

export GIT_SSH_COMMAND="ssh -vv"

To fix it, I added a custom entry in my config_ssh or ~/.ssh/.config allowing more legacy algorithms for that host. Please note this should appear above any Host * section:

# 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


来源:https://stackoverflow.com/questions/33410640/unable-to-negotiate-a-key-exchange-method-with-mina-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!