← Back to search

Connect to SSH with Legacy Algorithms

enumerationtool

Summary

Re-enable deprecated key-exchange and host-key algorithms so a modern SSH client can connect to an old/legacy SSH server.

Walkthrough

Modern OpenSSH disables old algorithms by default, so connecting to legacy servers needs them re-enabled explicitly.

Steps

  1. Pass -oKexAlgorithms=+... and -oHostKeyAlgorithms=+ssh-rsa to opt the deprecated algorithms back in for that connection when SSH refuses with a "no matching key exchange / host key" error.

Commands

bash

ssh -oKexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1 -oHostKeyAlgorithms=+ssh-rsa root@<TARGET>