Using "KexAlgorithms diffie-hellman-group1-sha1" did not resolve the "key exchange method not found"

There are many questions about the following error, but they all have the same solution, which has no effect:

$ git push 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. Please make sure you have the correct access rights and the repository exists. 

There is an article on openssh.com that did not help. In particular, it was suggested:

... in the file ~ / .ssh / config:

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

I did just that. I assume ~ allows %userprofile% on windows. My file is located in C:\Users\MY_USERNAME\.ssh\config :

 ## use kex algorithm ## Host 192.168.XXX.XXX KexAlgorithms diffie-hellman-group1-sha1 

As a result, nothing has changed. There is also a suggestion to use ssh -o , but I still have to find an answer that makes it difficult to describe how you do it. I tried this:

 $ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] 

I need to connect to this GIT repository. I'm on the windows. The repository uses Gerrit. I also use SourceTree and it has no issues with clicking in the repository . This way the repository works, but GIT or openSSH in my bash is broken.

What did I do wrong that this solution did not work for me?

+6
source share
3 answers

Solved with this command, I accidentally found a stream in some comments:

 export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1' 

Must be called every time you open Git Bash. Yes, Git is hell.

+7
source

I solved a similar problem in Windows 10 by updating my version of Open SSH to the latest version (7.5p1-1), and then making sure that C: Program Files \ OpenSSH \ bin was the first entry in the system path, so I used this ssh.exe file , not others.

0
source

I am using git bash on Windows 10 and this problem arose and I solved it by modifying the ssh.config file in C: \ Program Files \ Git \ etc \ ssh as you described.

0
source

All Articles