debonair debonair - 3 months ago 21
Git Question

Issue with cloning git repository

I am trying to clone the git repository and i am getting error

Unable to negotiate with <server>: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.


I edited
~/.ssh/config
and added

Host somehost.example.org
KexAlgorithms +diffie-hellman-group1-sha1"


but still I am getting same error.

Other solution is to use the command
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@127.0.0.1 -p 2222
but I am getting connection refused with port no 22 as well.

I am using windows machine.

Answer

Your problem is described in details here:

If the client and server are unable to agree on a mutual set of parameters then the connection will fail.
OpenSSH (7.0 and greater) will produce an error message like this:
Unable to negotiate with 127.0.0.1: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1


Setting alternate ssh keys

ssh-keygen -t rsa -C <your comment>

now add the public key under your server account and try again.