-1

I've come across this error:

$ git fetch ssh://name@gerrit.XXXXX:XXXXX/ xxx && git checkout FETCH_HEAD
Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

This is what they suggest on OpenSSH website:

For the case of the above error message, OpenSSH can be configured to enable the diffie-hellman-group1-sha1 key exchange algorithm (or any other that is disabled by default) using the KexAlgorithms option - either on the command-line:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@legacyhost

It did not occur to the author of the document that it is not obvious what user@legacyhost should be. Could you fill this information for me? I tried my gerrit login, that didn't work.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

1
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@legacyhost

This is just an example meaning "if your were trying ssh user@legacyhost and saw the said error then provide the -oKexAlgorithms=+diffie-hellman-group1-sha1 option to ssh.

When using ssh under the hood of git, you must provide that option through the ~/.ssh/config file:

Host gerrit.XXXXX
    KexAlgorithms +diffie-hellman-group1-sha1
Leon
  • 31,443
  • 4
  • 72
  • 97