How-Tos

How-To: Check Whether Your SSH Connections Use Post-Quantum Key Exchange

Leave a comment

The NSA just told national security system owners to speed up their move to post-quantum crypto. SSH is one of the easiest places to start, because modern OpenSSH already supports hybrid post-quantum key exchange. Here’s how to check yours. Replace user@your-server with your own host. Everything here is read-only except the last step.

1. Your client version and supported PQ algorithms

ssh -V
ssh -Q kex | grep -E 'mlkem|sntrup' 

You want to see mlkem768x25519-sha256, which is the default since OpenSSH 10.0, and/or sntrup761x25519-sha512, the default since 9.0. If neither shows up, your client is too old.

2. What a real connection negotiates

ssh -v user@your-server exit 2>&1 | grep 'kex: algorithm'

If that prints curve25519-sha256 or older instead of one of the PQ names, the server (or a config somewhere) is the weak link. Recent OpenSSH clients also warn you when a connection isn’t using a post-quantum key exchange.

3. What your server offers

sudo sshd -T | grep -i '^kexalgorithms'

Make sure the PQ algorithms are listed and come first.

4. Prefer PQ explicitly (optional)

If you’ve pinned KexAlgorithms in an old hardening guide, that pin may be what’s blocking PQ. Update it in a drop-in rather than the main file:

# /etc/ssh/sshd_config.d/10-pq-kex.conf
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256
sudo sshd -t && sudo systemctl reload sshd   # the unit is "ssh" on Debian/Ubuntu

Keep your current session open and test a new login before you log out. Keeping curve25519-sha256 at the end lets older clients still connect. Note this protects the key exchange (the harvest-now, decrypt-later risk). Your host and user keys are still classical signatures for now.

God Bless, and Happy hacking!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.