"no matching host key type found. Their offer: ssh-rsa": fixing SSH to old Cisco and network gear on macOS 26 and OpenSSH 10
Short answer. The device only offers algorithms that current OpenSSH no longer uses by default. Switch them back on for that one device in ~/.ssh/config, with a + so the modern defaults stay first. Add only the lines whose error you actually see, and never put them under Host *. One case can't be fixed this way: ssh-dss (DSA) was removed from OpenSSH 10.0, so no option brings it back.
# ~/.ssh/config
Host old-switch 192.0.2.50
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
KexAlgorithms +diffie-hellman-group14-sha1
For a single try without touching the file, pass the same options on the command line:
ssh -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group14-sha1 [email protected]
Which error needs which line
Each message names what the two sides couldn't agree on, and Their offer
lists what the device has. Pick the strongest algorithm in that list and add only that one.
| What ssh prints | What it means | Line for that host |
|---|---|---|
no matching host key type found. Their offer: ssh-rsa | The device signs its RSA host key with SHA-1 only | HostKeyAlgorithms +ssh-rsa |
no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 | Only SHA-1 key exchange methods are offered | KexAlgorithms +diffie-hellman-group14-sha1. Use diffie-hellman-group1-sha1 only when nothing else is offered |
no matching cipher found. Their offer: aes128-cbc,3des-cbc | Only CBC ciphers are offered | Ciphers +aes128-cbc, or +aes256-cbc if the device lists it |
Permission denied (publickey) right after the host key line was fixed, with an RSA key | The device accepts only SHA-1 signatures from your RSA key | PubkeyAcceptedAlgorithms +ssh-rsa. Not needed for password logins |
no matching host key type found. Their offer: ssh-dss | The device has only a DSA host key | None in OpenSSH 10. See ssh-dss below |
The option names are spelled as in the ssh_config manual [1]. To see what your client supports and what will be used for a host:
ssh -Q kex # key exchange methods this ssh can do at all
ssh -Q key # key types (no ssh-dss on OpenSSH 10)
ssh -G old-switch | grep -i -E 'kexalgorithms|hostkeyalgorithms|ciphers'
Why it stopped working
Nothing changed on the device. The client moved on, one release at a time, and macOS 26 ships a current client: on macOS 26.6, ssh -V prints OpenSSH_10.3p1.
- OpenSSH 7.0 (11 August 2015) disabled
diffie-hellman-group1-sha1andssh-dsskeys by default [2]. - OpenSSH 8.2 (14 February 2020) removed
diffie-hellman-group14-sha1from the default key exchange list [3]. - OpenSSH 8.8 (26 September 2021) disabled RSA signatures that use SHA-1, which is what the name
ssh-rsameans, and gave the two-lineHostkeyAlgorithmsandPubkeyAcceptedAlgorithmsstanza as the way to re-enable them for one host [4]. - OpenSSH 9.8 (1 July 2024) turned DSA off at compile time, and OpenSSH 10.0 (9 April 2025) removed it completely [5] [6].
The ssh-rsa case is the most common one on switches and routers, and it is milder than it looks. The RSA key itself is fine. What OpenSSH refuses is the SHA-1 signature made with it; rsa-sha2-256 and rsa-sha2-512 use the same key with a better hash. That is why a firmware upgrade on the device often makes the error go away without any change on your side.
Why per host, never globally
Under Host * these lines would let every server you connect to fall back to SHA-1, including the ones that have no reason to. Inside a Host block they apply to the devices you named and nothing else.
The + matters as well. Without it, the value replaces the whole default list, so the host gets only the old algorithm. With it, the old algorithm is appended, and the day the device learns something better, ssh picks that by itself [7]. OpenSSH describes re-enabling these algorithms as a stopgap until the device is upgraded [7].
Patterns keep the block short when you have a rack of similar devices:
Host sw-old-* 192.0.2.*
HostKeyAlgorithms +ssh-rsa
KexAlgorithms +diffie-hellman-group14-sha1
That block is also your upgrade list: every host that matches it is a device that needs new firmware or a replacement. A July 2026 article on the APNIC Blog gives the same advice: relax the settings only for matching hosts and treat the list as a migration backlog [10].
Devices that only offer ssh-dss
Older guides say to add HostKeyAlgorithms +ssh-dss. On OpenSSH 10 that line is itself an error, because the client no longer contains DSA [6]. On macOS 26.6 we got:
command-line line 0: Bad key types '+ssh-dss'.
What is left:
- Give the device an RSA key. Many devices that present a DSA key can generate an RSA one. On Cisco IOS, Cisco's SSH guide uses
crypto key generate rsawith a modulus of 2048 bits or more, andip ssh version 2[8]. After that you are in thessh-rsacase above, or better. - Upgrade the firmware if a release with newer SSH exists for the model.
- Use a client that still has DSA, from one controlled place. That means an OpenSSH older than 10.0 that was built with DSA, kept on a jump host for this purpose only, or PuTTY, whose manual still lists DSA among its host key types [9].
- Use the serial console for a device that can do none of this.
What we tested
On 4 December 2026, on macOS 26.6 with the system OpenSSH_10.3p1, we pointed ssh at a local test server restricted to old algorithms. An ssh-rsa-only host key, SHA-1-only key exchange and CBC-only ciphers each produced the messages in the table, and each matching line fixed its own error. An RSA key was accepted only after PubkeyAcceptedAlgorithms +ssh-rsa. Both diffie-hellman-group14-sha1 and diffie-hellman-group1-sha1 are still in ssh -Q kex; ssh-dss is not in ssh -Q key. We did not test against a real Cisco or other network device, so the wording of Their offer
on your device will differ.
How MyXterm handles old algorithms
We make MyXterm, a free, open-source SSH client and connection manager; its first stable release is v0.1.0. Here is exactly what it does with such devices today. It has two SSH engines, chosen per session in Advanced SSH.
- System OpenSSH is the default on macOS and Linux. The tab runs your own
ssh, which reads~/.ssh/config, so theHostblock above works for MyXterm sessions as it is. MyXterm doesn't pass algorithm options of its own, so that your configuration stays in charge [11]. The DSA limit is the same as in a terminal. - The built-in engine is the default on Windows and optional elsewhere. It offers no SHA-1
ssh-rsahost keys, no SHA-1 key exchange, no CBC ciphers and no DSA, and it has no switch for them yet [12]. A per-host opt-in for legacy algorithms is planned SSH-015. Until then, a device that offers onlyssh-rsacan't be reached with this engine.
We have not tested MyXterm against real legacy network devices. For the rest of the network engineer's kit (serial consoles, Telnet, SCP to devices without SFTP), see the guide for network engineers.
FAQ
How do I fix "no matching host key type found. Their offer: ssh-rsa"?
Add HostKeyAlgorithms +ssh-rsa for that host only, in a Host block of ~/.ssh/config or with ssh -o. If you sign in with an RSA key, also add PubkeyAcceptedAlgorithms +ssh-rsa. The plus sign keeps the modern defaults first. Do not put these lines under Host *.
Can I re-enable ssh-dss on macOS 26?
No. macOS 26 ships OpenSSH 10, and OpenSSH 10.0 removed DSA completely, so HostKeyAlgorithms +ssh-dss is rejected with Bad key types. Generate an RSA host key on the device, upgrade its firmware, or use a client that still supports DSA from a dedicated jump host.
Is it safe to enable ssh-rsa and diffie-hellman-group14-sha1?
They are weaker than the defaults because they rely on SHA-1, which is why OpenSSH turned them off. Enabling them for one named device on a management network is a common stopgap; enabling them for every host is not. OpenSSH itself describes this as temporary until the device is upgraded.
Sources
Read on 4 December 2026. OpenSSH facts are from its release notes and manual. MyXterm statements are from the repository on the same day; planned
means it isn't built.
- OpenBSD manual, ssh_config(5):
HostKeyAlgorithms,PubkeyAcceptedAlgorithms,KexAlgorithms,Ciphers: man.openbsd.org/ssh_config - OpenSSH 7.0 release notes, 11 August 2015: openssh.org/txt/release-7.0
- OpenSSH 8.2 release notes, 14 February 2020: openssh.org/txt/release-8.2
- OpenSSH 8.8 release notes, 26 September 2021: openssh.org/txt/release-8.8
- OpenSSH 9.8 release notes, 1 July 2024: openssh.org/txt/release-9.8
- OpenSSH 10.0 release notes, 9 April 2025: openssh.org/txt/release-10.0
- OpenSSH, Using OpenSSH with legacy SSH implementations: openssh.org/legacy.html
- Cisco, Configure SSH on Routers (document 4145, updated 30 July 2026): cisco.com/c/en/us/support/docs/security-vpn/secure-shell-ssh/4145-ssh.html
- PuTTY manual, chapter 4, host key type selection: the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter4.html
- APNIC Blog, SSH key exchange failures when managing legacy network devices, 3 July 2026: blog.apnic.net/2026/07/03/ssh-key-exchange-failures-when-managing-legacy-network-devices
- MyXterm feature list, SSH-106 (system OpenSSH is not overridden) and SSH-015: docs/features.toml
- MyXterm built-in SSH engine, algorithm preferences and their tests: crates/ssh/src/client.rs
Last updated