SSH

How to Fix SSH No Matching Host Key Type Found

Read the server's ssh-rsa or ssh-dss offer, check what your OpenSSH client supports, and choose a server-side fix or a one-host RSA workaround.

Updated 2026-11-224 min read

No matching host key type found means SSH stopped while trying to authenticate the server, before it checked your username or private key. Read the names after Their offer: at the end of the error.

Server’s offer Next step
ssh-rsa only The server offers RSA signatures with SHA-1. Upgrade its SSH software or firmware so it can use RSA with SHA-2, or configure a modern host key. An existing RSA key can often stay in place.
ssh-dss only Upgrade the server or use its management console to configure a supported host key. OpenSSH 10.0 removed DSA support, so a client option cannot restore it on that version or later.
ssh-rsa,ssh-dss Fix the RSA or modern host-key path on the server. For a verified device that needs a temporary connection to complete the upgrade, see the one-host RSA exception below.

The algorithm name ssh-rsa in this error means RSA with SHA-1. An RSA public key can also authenticate a host using rsa-sha2-256 or rsa-sha2-512 when both endpoints support it. Replacing one RSA key with another on unchanged legacy firmware won’t add that support. OpenSSH release notes · OpenSSH legacy options

Capture the server’s offer

ssh -vvv user@example.com

The final error usually includes the algorithms offered by the server:

Their offer: ssh-rsa,ssh-dss

Record the exact offer, hostname, port, address, and SSH banner. If the error says no matching key exchange method found, SSH failed to agree on how to establish the session keys. That error has a different fix.

Inspect the effective client policy

ssh -G example.com | grep -E '^(hostname|port|hostkeyalgorithms|proxyjump|proxycommand) '
ssh -Q HostKeyAlgorithms

The query lists algorithms the client understands; the effective configuration shows what it will use for this destination after user, system, and included configuration files are applied.

System-wide cryptographic policy may disable an algorithm even when the SSH binary supports it. Inspect the operating system policy before assuming ~/.ssh/config is the only source.

Confirm the intended server

DNS changes, port forwarding, bastions, and load balancers can lead to an older SSH endpoint than expected:

getent ahosts example.com
nc -v example.com 22

Compare every returned address if behavior is inconsistent. The banner should begin with SSH-2.0-, but it does not by itself authenticate the endpoint.

Inspect available server host keys

Using console access or another approved administrative path:

sudo sshd -T | grep hostkey
sudo find /etc/ssh -maxdepth 1 -type f -name 'ssh_host_*_key.pub' -print
sudo ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

If the server already has a modern host key, check that its HostKey configuration loads it. If it only has an RSA key, check whether a software or firmware upgrade adds RSA/SHA-2 support for that key. If a new key is needed, record its fingerprint from the console and distribute it through a trusted channel. Validate the configuration before reloading:

sudo sshd -t

Keep an existing administrative session open while changing server SSH configuration so a mistake does not lock out recovery.

Use a temporary client exception carefully

If the offer includes ssh-rsa and you have independently verified the device’s RSA fingerprint, a client that still supports RSA/SHA-1 can append it for one connection. The + preserves the client’s preferred modern algorithms:

ssh -o HostKeyAlgorithms=+ssh-rsa user@example.com

Leave PubkeyAcceptedAlgorithms alone for this error. If the host check succeeds and you then see Permission denied (publickey), diagnose the user key separately.

A narrowly scoped configuration looks like:

Host legacy-example
    HostName example.com
    HostKeyAlgorithms +ssh-rsa

Never place legacy compatibility beneath Host *. Verify the host-key fingerprint through a trusted channel before accepting it, document the exception, and set a removal date.

Diagnose it with Rumus

Rumus AI-native terminal workspace showing a command-line session
AI-native terminal Commands require your approval
Why use Rumus for this diagnosis?

Rumus is an AI-native terminal that connects to your real SSH hosts and understands the active connection context. It can inspect SSH configuration, identities, network paths, and server logs instead of guessing from an isolated chat.

What Rumus can inspect

  • SSH config, keys, and effective connection settings
  • Jump hosts, proxies, ports, and network reachability
  • Server authentication logs and file permissions
Download Rumus
Diagnose this SSH no matching host key type error. Capture the algorithms offered
by the server; inspect the effective client host-key policy, system crypto policy,
destination addresses, port, banner, proxy and jump-host path; and, when server
access exists, inventory configured host keys and the SSH version. Prefer a server
upgrade. Do not enable legacy algorithms, generate keys, or reload sshd without
approval, and verify fingerprints through a trusted channel.

Confirm the fix

ssh -vvv user@example.com

After the upgrade, remove the exception and reconnect with your usual alias. Read kex: host key algorithm: for the negotiated algorithm, such as ssh-ed25519 or rsa-sha2-512, then compare the Server host key: fingerprint with the value verified out of band. On an upgraded RSA host the key fingerprint can stay the same while the signature algorithm changes to SHA-2.

Diagnose the real environment

Open the server in Rumus and let the AI agent inspect context, propose a plan, and ask before it runs changes.

Download Rumus