MAC OSX – SSH Error ‘No Matching Exchange Method Found’


KB ID 0001245 Dtd 13/10/16


I thought my RoyalTSX had broken today, I upgraded it a couple of weeks ago, and I upgraded to macOS Sierra version 10.12 the other day. After this, all my SSH sessions refused to connect with this error;

Mac OSX SSH Error no matching key exchange


Unable to negotiate with x.x.x.x port 22: no matching key exchange found. Their offer diffie-hellman-group1-sha1


This is not Apple's fault, it's OpenSSH version 7. SHA1 is weak, so support for it has been removed. Which is fine, but all my clients Cisco Firewalls/Routers/Switches are probably all using  RSA/SHA1. So until they re all updated I'm going to need to re-enable SHA1.

Open a terminal windows and execute the following;

sudo nano /etc/ssh/ssh_config

Locate the line ' #   MACs hmac-md5,hmac-sha1,,hmac-ripemd160' and remove the Hash/Pound sight from the beginning. Then paste the following on the end;

HostkeyAlgorithms ssh-dss,ssh-rsa

KexAlgorithms diffie-hellman-group1-sha1


MacOSX Allow SHA1

 Theres no reason to reboot, it should work straight away.

Related Articles, References, Credits, or External Links


Author: PeteLong

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *