1

I'm trying to clone a repo on Windows with MINGW64 and I get this error.

$ git clone ssh://user@server/myproject && scp -p -P XXXXX user@server:hooks/commit-msg myproject/.git/hooks/
Cloning into 'myproject'...
Unable to negotiate with XXX.XXX.XX.XXX: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

*Already check the doc http://www.openssh.com/legacy.html and the Solution in the post http://www.openssh.com/legacy.html and still get the error.

Already added this to my config file Host somehost.example.org KexAlgorithms +diffie-hellman-group1-sha1

Any Help?

Community
  • 1
  • 1
Rafael Reyes
  • 2,615
  • 8
  • 34
  • 51

1 Answers1

9

group1 is weak and should be disabled; see https://weakdh.org/sysadmin.html

A server that only supports group1 is really bad. Asking the server operator to upgrade it is the right fix.

If you're desperate to connect to it anyway, you should be able to tell your client to enable it with the ssh option KexAlgorithms +diffie-hellman-group1-sha1. It can be set in the ssh config file or on the command line with -o. If you want to use the command line option you'll need to tell git to pass the option to ssh, which is explained in the answers to this question: Passing ssh options to git clone

Community
  • 1
  • 1
  • 1
    It works! Thanks for your answer! – Rafael Reyes May 12 '16 at 15:07
  • The repository specific config file of git did not pick up the command line arguments given using -o. So I had to give these parameters (KexAlgorithms +diffie-hellman-group1-sha1) to ssh in ~/.ssh/config. Then it worked. I suspect the issue was that when I gave these parameters to the repository specific git config file, the ssh hostname that git was picking up was the actual IP address, while when I gave these parameter to the ssh config file, ssh applied it to the FQDN of the hostname, and it worked. It is weird. – zafar142003 Jul 18 '17 at 04:50