Post-Quantum SSH
A procedure for developers · 3 December 2026
Every SSH connection should use post-quantum key exchange where both ends support it. This procedure shows how to check that, how to configure the client, which keys to use, and what to do with hosts that cannot comply. It applies to OpenSSH on macOS, Linux, Windows and WSL.
Why now
On 2 December 2026 the NSA published advisory PP-26-4956, Immediate Actions to Push Toward Post-Quantum. It tells owners of national security systems to move to post-quantum cryptography now. Its press release gives two reasons: companies at the frontier of AI disclosed findings that affect some cryptographic systems, and adversaries already record encrypted traffic to decrypt later.
The advisory binds only national security systems. Its steps apply to any network: make an inventory, update, configure, then isolate what cannot be fixed.
SSH has two separate risks. Treat them differently.
| Part of SSH | What an attacker can do | When the risk starts | Priority |
|---|---|---|---|
| Key exchange (session keys) | Record a session today and decrypt it when a large quantum computer exists | Now: the recording happens today | Fix now |
| Host and user keys (signatures) | Impersonate a server or a user during a live connection | Only when a large quantum computer exists | Plan; change when tools allow |
Post-quantum key exchange in OpenSSH is hybrid. mlkem768x25519-sha256
(the default since OpenSSH 10.0) and sntrup761x25519-sha512 each combine a
post-quantum algorithm with X25519, so the result is at least as strong as
curve25519-sha256 alone.
Rules at a glance
Do
- Use an SSH client that lists
mlkem768x25519-sha256inssh -Q kex. - Put the post-quantum algorithms first in the client's
KexAlgorithms(Procedure 3). - Check new hosts and changed clients with the one-line test in Procedure 2.
- Use Ed25519 keys for normal work. Use RSA (3072 bits or more) or ECDSA P-384 only where a host rejects Ed25519.
- Scope each legacy exception to that host in your SSH configuration, and record it in the exception register (Procedure 5).
- Leave the server option
WarnWeakCryptoon (OpenSSH 10.6 and later), and act on what it logs.
Don't
- Don't set
KexAlgorithmsorHostKeyAlgorithmsin aHost *block to make an old device work. - Don't turn off the client warning about non-post-quantum key exchange (
WarnWeakCrypto no). - Don't create new RSA keys under 3072 bits, or DSA keys.
- Don't use
mldsa44-ed25519keys made with OpenSSH 10.4 or 10.5. They use an old experimental name that 10.6 rejects. - Don't remove your only working key from a host before you test the new key in a second session.
Procedure 1: Check your client
The client passes when it supports mlkem768x25519-sha256 and offers a post-quantum algorithm first.
-
Show the client version:
ssh -V -
List the post-quantum key exchange algorithms it supports:
Pass: the output includes
ssh -Q kex | grep -E 'mlkem|sntrup'mlkem768x25519-sha256. No output: the client has no post-quantum support. Use another client until you can update it. -
Show the order the client offers to a host:
Pass: the list starts with
ssh -G <host> | grep '^kexalgorithms'mlkem768x25519-sha256orsntrup761x25519-sha512. Fail: it starts with a classical algorithm such asecdh-sha2-nistp256orcurve25519-sha256. Go to Procedure 3.
Two client defaults that failed this check in a test on 3 December 2026:
-
macOS 26.7.3, built-in
/usr/bin/ssh(OpenSSH 10.5p1): supports ML-KEM, but offersecdh-sha2-nistp256first. It therefore uses classical key exchange even with post-quantum servers. Procedure 3 fixes this. -
OpenSSH for Windows 9.5p2: lists no post-quantum key exchange. Use a newer build that passes
step 2, or the
sshin WSL.
Procedure 2: Check what a connection negotiates
The negotiated algorithm is what protects the session, so test the connection, not only the configuration.
-
Connect with debug output and read the key exchange line:
ssh -v <host> true 2>&1 | grep 'kex: algorithm' -
Read the result:
Result Meaning Action mlkem768x25519-sha256Post-quantum hybrid, current standard None sntrup761x25519-sha512, with or without@openssh.comPost-quantum hybrid, older None. Prefer ML-KEM when the server is updated curve25519-sha256,ecdh-sha2-nistp*,diffie-hellman-*Classical only If the server supports post-quantum key exchange, fix the client (Procedure 3). If not, Procedure 5 -
To check a server without logging in, turn authentication off. The key exchange still runs,
and
known_hostsis not read or changed:Thessh -vvv -o BatchMode=yes -o PubkeyAuthentication=no \ -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no \ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ <host> true 2>&1 \ | grep -E 'remote software version|kex: algorithm|KEX algorithms' | head -3KEX algorithmsline is the server's list. Look formlkemorsntrupin it.
Clients from OpenSSH 10.1 also print a warning when a connection uses classical key exchange. Treat that warning as a failed check.
Procedure 3: Configure your client
Require post-quantum key exchange by default, and allow classical key exchange only for named legacy hosts.
A connection to an unlisted legacy host then fails with Unable to negotiate instead of
falling back without notice.
- Open
~/.ssh/config. On Windows it is%USERPROFILE%\.ssh\config; WSL has its own~/.ssh/config. -
Put the legacy exceptions first.
sshuses the first value it finds for each option, so theHost *block comes last. The host names below are examples.# Legacy hosts without post-quantum key exchange. # Each one is listed in the exception register (Procedure 5). Host old-router old-router.example.net KexAlgorithms [email protected] Host old-nas old-nas.example.net KexAlgorithms curve25519-sha256 Host fips-hypervisor fips-hypervisor.example.net KexAlgorithms ecdh-sha2-nistp384,ecdh-sha2-nistp256 # Everything else: post-quantum only. Host * KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,[email protected] - Test every host you use with Procedure 2. Each host outside the exception list must show
mlkem768x25519-sha256orsntrup761x25519-sha512. - If a host fails with
Unable to negotiate, check it with Procedure 2, step 3. If the server has no post-quantum algorithm, follow Procedure 5 before you add an exception.
If you cannot add the exceptions yet, use this Host * setting for now.
It puts the post-quantum algorithms first but keeps the classical fallback:
Host *
KexAlgorithms ^mlkem768x25519-sha256,sntrup761x25519-sha512A client with no post-quantum support cannot use the strict setting at all. Replace or update it first.
Procedure 4: SSH keys
You don't need to replace your keys yet. Use Ed25519 now. Add mldsa44-ed25519 keys
beside them when both ends run OpenSSH 10.6 or later.
Which key to use
| Situation | Key type | Command |
|---|---|---|
| Normal use | Ed25519 | ssh-keygen -t ed25519 |
| Host rejects Ed25519 (for example, an SSH server in FIPS mode) | ECDSA P-384, or RSA with 3072 bits or more | ssh-keygen -t ecdsa -b 384ssh-keygen -t rsa -b 3072 |
| Both ends run OpenSSH 10.6 or later | mldsa44-ed25519, in addition to Ed25519 |
ssh-keygen -t mldsa44-ed25519 |
Check your existing keys
for f in ~/.ssh/*.pub; do ssh-keygen -lf "$f"; doneReplace any RSA key under 3072 bits, and any DSA key.
Add a post-quantum user key
- Confirm that both ends support it:
ssh -Q key | grep mldsaon the client, and OpenSSH 10.6 or later on the server. - Make the key:
ssh-keygen -t mldsa44-ed25519 -f ~/.ssh/id_mldsa44_ed25519. - Add the public key to
~/.ssh/authorized_keyson the server. Keep your Ed25519 key there too. - Test in a second terminal:
ssh -i ~/.ssh/id_mldsa44_ed25519 -o IdentitiesOnly=yes <host> true. Keep the first session open until the test passes. - Add
IdentityFile ~/.ssh/id_mldsa44_ed25519for that host in~/.ssh/config, above the Ed25519 line.
Add a post-quantum host key
- On a server with OpenSSH 10.6 or later, run
sudo ssh-keygen -A. It creates themldsa44-ed25519host key beside the existing ones. - Reload
sshd. Clients learn the new host key on their next connection throughUpdateHostKeys. Keep the old host keys in place.
Notes
-
mldsa44-ed25519is a hybrid of ML-DSA-44 and Ed25519. It is below the level the NSA requires for national security systems (ML-DSA-87), but it is the post-quantum signature that OpenSSH ships. - The NSA's algorithm lists (CNSA 1.0 and 2.0) do not approve EdDSA (Ed25519). That rule applies to national security systems; Ed25519 remains secure against classical attacks.
Procedure 5: Legacy hosts
A host that cannot do post-quantum key exchange gets a recorded exception, a restricted network path and an upgrade plan. This follows step 6 of the NSA advisory.
- Confirm with Procedure 2, step 3, that the server offers no
mlkemorsntrupalgorithm. - Check whether a software or firmware update adds it. If one does, install it and stop here.
- Add the host to the exception register: host, SSH server version, the key exchange it uses, owner and upgrade path.
- Limit who can reach its SSH port: internal network only, and only from management workstations. Never expose it to the internet.
- Add a scoped exception to the client configuration (Procedure 3), with the strongest classical algorithm the server offers.
- Where another path exists, do not send long-lived secrets over these sessions.
Exception register
Keep one table like this per team. The row below is an example.
| Host | SSH server | Key exchange used | Owner | Upgrade path |
|---|---|---|---|---|
old-router.example.net |
OpenSSH 6.6 | [email protected] |
Network team | No vendor update. Replace the device |
Sources
- NSA, Immediate Actions to Push Toward Post-Quantum, PP-26-4956, version 1.0, December 2026.
- NSA, press release, 2 December 2026.
- NSA, Post-Quantum Cryptography Resource Hub.
- OpenSSH, release notes: 10.0 (ML-KEM default), 10.1 (client warning), 10.4 (experimental
mldsa44-ed25519), 10.6 and 10.6p2 (mldsa44-ed25519enabled;WarnWeakCryptoinsshd). - ASD's ACSC, CISA and NSA, Post-quantum questions to ask your vendors, 2026.
- OMB, M-26-15: Execution of the Migration to Post-Quantum Cryptography, 2026.