TL;DR: Aim for OpenSSH 10.6p2 or newer for hybrid post-quantum SSH keys.
- macOS 27.2: The built-in 10.5 client is too old. Install a newer version with
brew install openssh. - OPNsense 26.7.10: Ships 10.6p2, so it works.
- Debian 13 and Ubuntu 26.04: Stable repositories don't have a new enough version yet. Watch for an update.
With a compatible client, prefer the new algorithms in ~/.ssh/config:
Host *
PubkeyAcceptedAlgorithms ^ssh-mldsa44-ed25519
HostKeyAlgorithms ^ssh-mldsa44-ed25519
KexAlgorithms ^mlkem768x25519-sha256The ^ keeps the default algorithms as fallbacks. This prefers the new algorithms rather than requiring them.
After reading the NSA's advisory to accelerate the transition to post-quantum cryptography and Filippo Valsorda's take on it, I wanted to try post-quantum SSH on my homelab. The OpenSSH post-quantum page is also a useful introduction to key exchange.
My OPNsense firewall was ready for it, but my Proxmox host and Ubuntu container needed a newer OpenSSH version than their repositories currently provide.
Key exchange vs. authentication#
An SSH connection involves a few separate pieces:
- Key exchange establishes the shared secrets used to encrypt the session. A post-quantum key exchange helps protect traffic recorded today from being decrypted later by a sufficiently capable quantum computer.
- The server's host key lets the client verify the identity of the server it's connecting to.
- Your user key lets the server verify your identity when you log in.
OpenSSH's post-quantum algorithms are hybrids: they combine a post-quantum algorithm with a classical one. For example, mlkem768x25519-sha256 combines ML-KEM with X25519 for key exchange, while ssh-mldsa44-ed25519 combines ML-DSA-44 and Ed25519 for signatures.
Updating your user key doesn't change the server's host key, and neither tells you which key exchange the connection negotiated.
Filippo's post also discusses a possible more immediate threat to some elliptic curve cryptography. That is his interpretation of an advisory that doesn't disclose the underlying discoveries, not a published demonstration of a specific attack.
Which OpenSSH version do I need?#
These are the packages I checked on December 3, 2026. Check your own repositories for newer versions.
| System | OpenSSH version | Hybrid key exchange | Current hybrid authentication keys |
|---|---|---|---|
| macOS 27.2, system OpenSSH | 10.5p1 on my Mac | Yes | Experimental format only |
| macOS, Homebrew OpenSSH | 10.6p2 | Yes | Yes |
| OPNsense 26.7.10 | 10.6p2 | Yes | Yes |
| Debian 13 / Proxmox VE 9 | 10.0p1 Debian package | Yes | No |
| Ubuntu 26.04 LTS | 10.2p1 | Yes | No |
The Debian package on my Proxmox host reports 10.0p2 in its SSH banner even though the package version is 10.0p1-7+deb13u4. My Ubuntu container reports 10.2p1-2ubuntu3.8.
Debian's package tracker lists 10.3 in Trixie backports and 10.6p2 in testing and unstable. Ubuntu's package listing has 10.2 for 26.04 LTS. Neither stable package supports the current hybrid signature format. Distribution backports can change this, so version numbers alone aren't always definitive.
OpenSSH 10.4 and 10.5 had experimental support for ML-DSA-44/Ed25519 signatures, but 10.6 changed the format and enabled it by default. Keys generated with the experimental implementation must be regenerated. I ran into this myself.
Getting a newer SSH client on macOS#
My Mac's system ssh-keygen was OpenSSH 10.5p1, so the first key I generated used the experimental format. Check the start of your public key to see which one you have:
head -c 100 ~/.ssh/id_mldsa44_ed25519.pubThe experimental key starts with ssh-mldsa44-ed25519@openssh.com. The current format starts with ssh-mldsa44-ed25519, without the suffix. Don't share your private key.
I installed OpenSSH 10.6p2 via Homebrew:
brew install openssh
"$(brew --prefix openssh)/bin/ssh" -VThen I generated a new key at a different path, leaving the old one alone:
"$(brew --prefix openssh)/bin/ssh-keygen" \
-t mldsa44-ed25519 \
-f ~/.ssh/id_mldsa44_ed25519_10_6Optionally choose a passphrase when prompted. The file ending in .pub is the public key to add to a server; the other file is your private key and stays on your Mac.
To prefer Homebrew's tools in zsh, add this to ~/.zshrc:
export PATH="$(brew --prefix openssh)/bin:$PATH"Open a new shell or run source ~/.zshrc, then check type -a ssh and ssh -V. This changes the tools found by your shell, not necessarily GUI apps or programs that call /usr/bin/ssh directly.
Prefer the new algorithms#
The ^ in the config at the top puts each algorithm at the front of the default list. Older hosts can still connect using a classical host key or key exchange if that's all they support. To require an algorithm instead, use a host-specific setting without ^ and test it before relying on it.
SSH normally uses the first value it finds for an option, so put host-specific settings above Host *. A global config containing these algorithm names may not work with older clients, including apps that explicitly use the macOS system binary.
To inspect the effective configuration for a host:
ssh -G my-host | grep -E '^(pubkeyacceptedalgorithms|hostkeyalgorithms|kexalgorithms) 'That shows what the client is configured to offer, not what the connection actually uses.
Testing OPNsense#
My OPNsense 26.7.10 firewall runs OpenSSH 10.6p2. After adding my new public key to my user account and keeping the old key as a fallback, I connected with:
ssh -vv my-firewallThe useful parts of the output looked like this:
debug1: kex: algorithm: mlkem768x25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: Server accepts key: ... MLDSA44-ED25519 ...
Authenticated to my-firewall using "publickey".The connection used ML-KEM and accepted my hybrid user key, but still used an Ed25519 host key. The server offered a hybrid host key too; my client had picked Ed25519 under its previous preference order.
I tested the hybrid host key explicitly:
ssh -vv -o HostKeyAlgorithms=ssh-mldsa44-ed25519 my-firewallThis time the output included kex: host key algorithm: ssh-mldsa44-ed25519. If SSH asks you to trust a new host key, compare its fingerprint with the one shown on the firewall's trusted console before accepting it.
To require that host key on future connections, I added a host-specific setting above Host *:
Host my-firewall
HostKeyAlgorithms ssh-mldsa44-ed25519With no ^, this requires the hybrid host key and fails instead of falling back. Keep your existing connection and a recovery path open while testing changes like this.
Debian and Ubuntu#
My Proxmox host runs Debian 13, and my Docker LXC container runs Ubuntu 26.04. Both servers are up to date using their configured repositories, but neither can accept the current ML-DSA user key. Offering it to the Ubuntu server failed and SSH moved on to the next authentication method.
Both connections negotiated mlkem768x25519-sha256, though. The server host keys were still Ed25519, and I logged in with my existing RSA user key. An older user key doesn't necessarily mean the connection uses a classical key exchange.
For now I'm keeping the distribution-managed SSH servers and my existing keys on these machines. A locally built package or a separate OpenSSH build could get me there sooner, but I'd need to maintain it myself. If you replace sshd or mix packages from another distribution release, make sure you have console access and a rollback plan.
Keeping an old authorized key is useful for compatibility, but it also remains another way to authenticate. Don't remove it until you've verified the replacement works and have a recovery path.
Check an existing connection#
Run this from the client you actually use:
ssh -vv my-hostLook for kex: algorithm, kex: host key algorithm, and Server accepts key. The first tells you the negotiated key exchange, the second the server's host-key algorithm, and the third which user key the server accepted.
ssh -V reports the client version. On a Linux server, sshd -V reports the daemon version, and ssh -Q key lists key types the local client knows about. The OpenSSH post-quantum page has more background on key exchange; its section saying post-quantum signatures are still in the future predates the 10.6 release.
