no matching key exchange method found issue for Ubuntu ssh

Samuel Yang
Sep 6, 2018 · 1 min read

Add the address and the algorithm in the ~/.ssh/config file:

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

Wild card may be used for the address.

e.g.

Host *.*.*

$ cat ~/.ssh/config
Host 10.*.*.*
KexAlgorithms +diffie-hellman-group1-sha1
Host 192.*.*.*
KexAlgorithms +diffie-hellman-group1-sha1

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade