Linux Basics

Unable to negotiate with port 22: no matching key exchange method found.

no matching key exchange method found
no matching key exchange method found

Unable to negotiate with <IP> port 22: no matching key exchange method found.

Sometimes you have met with the following error while you are trying to SSH to a server.

Unable to negotiate with 192.168.1.10 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

You can solve this by using the following command:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@192.168.1.10
Or you can permanently add the following to the ssh client configuration (.ssh/config) file:

Host 192.168.1.10
    KexAlgorithms +diffie-hellman-group1-sha1

For example:

Edit/Create the SSH client configuration file using your favorite editor
vim $HOME/.ssh/config

and add the following into it:

Host 192.168.1.10
    KexAlgorithms +diffie-hellman-group1-sha1

OpenSSH website has a page dedicated to this. Please read it here. This will give you some important information about the older algorithms.

That’s it!

Also Read:

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Add Comment

Click here to post a comment

Topics