SSH says no matching key exchange method, but the client lists the method as available
Trying to connect to an old network switch and the connection is refused with a complaint that no matching key exchange method was found, naming the one the switch offers.
What confuses me is that when I ask my client to list the key exchange algorithms it supports, the one in the error message is in the list. So the client knows about it and still will not use it.
Specifying it explicitly on the command line works, and a host entry in my SSH config works. But I would like to understand why it is not chosen automatically when both ends support it.
@distro_dana · 7d ago
Two adjacent things that bite in the same situation.
Ciphers and MACs go the same way. The removals happen in waves across releases, so a machine that connected to your switch last year may refuse this year after an upgrade, with a different algorithm named each time. If you maintain old equipment, expect this as a recurring maintenance item rather than a one-off.
Distribution-level crypto policies can override your config. Several distributions now ship a system-wide policy that constrains what SSH will do regardless of per-host settings. If your host block appears to be ignored, that is usually why, and the fix is at the policy level rather than in your config file.
The long-term answer for a switch is firmware, if any exists. Where it does not, the config entry is a legitimate way to keep managing hardware that outlived its crypto.
Reply
Report