07 June 2020

ssh legacy option

some older ssh server only support limited key exchange algorithm.

When you get this error:
no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1


Use this option :
-oKexAlgorithms=+diffie-hellman-group1-sha1


eg:
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@legacyhost


or put this in your .ssh/config file:
Host myhost.example.org
 KexAlgorithms +diffie-hellman-group1-sha1