Post-quantum SSH: mlkem768x25519-sha256 in OpenSSH and the 10.1 warning
On this page
Short answer: OpenSSH has used post-quantum key exchange by default since 9.0 (April 2022, sntrup761x25519-sha512) and switched the default to mlkem768x25519-sha256 in 10.0 (April 2025). Since 10.1 the client prints ** WARNING: connection is not using a post-quantum key exchange algorithm. when it ends up with a classical one. The fix is almost always to update the server, or remove a KexAlgorithms line that predates these algorithms.
The 30-second check
ssh -V # your client version
ssh -Q kex | grep -E "mlkem|sntrup" # PQ algorithms your client supports
ssh -v user@host exit 2>&1 | grep "kex: algorithm"The last line shows what was actually negotiated, for example kex: algorithm: mlkem768x25519-sha256.
Which versions support what
| OpenSSH | Post-quantum key exchange |
|---|---|
| 9.0 (Apr 2022) | sntrup761x25519-sha512 supported and default |
| 9.9 | adds mlkem768x25519-sha256 |
| 10.0 (Apr 2025) | mlkem768x25519-sha256 becomes the default |
| 10.1 | warns when a connection uses a non-PQ key exchange |
Both ends need support. A 10.x client talking to an 8.x server falls back to classical key exchange, and that is when the warning appears.
Fix the warning: update or reconfigure the server
- Check the server version:
ssh -v host 2>&1 | grep "remote software version". - If it is older than 9.0, update the OS package or base image. This is the real fix.
- If it is recent, look for a hardening line that overrides the defaults:
sudo sshd -T | grep -i kexalgorithms
grep -rn "KexAlgorithms" /etc/ssh/Many CIS-style hardening guides from before 2022 pinned curve25519-sha256 and DH groups only. Replace that with a list that puts the hybrids first:
# /etc/ssh/sshd_config.d/50-pq-kex.conf
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.orgRun ssh -Q kex on that server first and drop any name it doesn't list: sshd refuses to start on an unknown algorithm. Then sudo sshd -t && sudo systemctl reload ssh (the unit is sshd on some distributions). Keep a second session open while you reload.
Silencing the warning for one host
If you can't change a server (a network appliance, a vendor box), you can hide the warning for that host only. From the OpenSSH documentation:
# ~/.ssh/config
Match host legacy-switch.example.com
WarnWeakCrypto no-pq-kexDon't set it globally: the warning is how you find the hosts that still need updating.
Git hosting, CI and libraries
- Git over SSH: the hosting provider's server decides. Run
ssh -v git@your-git-host 2>&1 | grep "kex: algorithm"to see what you get. - Go
x/crypto/ssh: includemlkem768x25519-sha256inConfig.KeyExchangesif you set that field. - paramiko, JSch, Apache MINA SSHD: check each library's supported KEX list; older releases have none of the PQ algorithms, which makes the server fall back to classical.
Why SSH matters for harvest-now-decrypt-later
An SSH session that carries secrets (deploy keys, database dumps, admin sessions) can be recorded and decrypted later if the key exchange is classical. The host key and user key signatures are not exposed in the same way: they only need to hold during the login. See Harvest now, decrypt later.
pqshift flags KexAlgorithms lines in sshd_config/ssh_config, Dockerfiles and infrastructure repos and opens PRs that put the hybrid algorithms first while keeping classical ones as a fallback.
FAQ
What does 'connection is not using a post-quantum key exchange algorithm' mean?
OpenSSH 10.1+ prints it when the server only agreed a classical key exchange. Update the server to OpenSSH 9.9+ (or 9.0+ for sntrup761x25519) or remove a KexAlgorithms line that disables the PQ algorithms. WarnWeakCrypto no-pq-kex hides it per host.
Which OpenSSH version is post-quantum by default?
OpenSSH 9.0 (April 2022) made sntrup761x25519-sha512 the default. OpenSSH 10.0 (April 2025) switched the default to mlkem768x25519-sha256, added in 9.9.