Kexwatch

Fix guides

Post-quantum SSH: check and enable mlkem768x25519-sha256

Recent OpenSSH already protects SSH logins with a post-quantum hybrid key exchange by default. Most servers need no change. The ones that do usually have an old "hardening" line switching it off.

Keep your current SSH session open while you change anything. We tested it: on OpenSSH 9.6, adding mlkem768x25519-sha256 to the config is a fatal error, and sshd will not start. If that is the only way into your server, you are locked out.

Which version does what

OpenSSH versionWhat it uses by default
10.0 and newermlkem768x25519-sha256, the hybrid using the NIST standard ML-KEM. We tested 10.2 on Ubuntu 26.04.
9.0 to 9.9sntrup761x25519-sha512, an older post-quantum hybrid. Still protects against "harvest now, decrypt later". We tested 9.6 on Ubuntu 24.04.
Older than 9.0Classical only. Upgrade.

1. See what your server offers

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

The first name in the list is your server's first choice. Good: mlkem768x25519-sha256 or sntrup761x25519-sha512. If the list starts with curve25519-sha256, or has no mlkem or sntrup entry at all, go to step 2.

2. Find the line that turns it off

sudo grep -Ri "^ *KexAlgorithms" /etc/ssh/sshd_config /etc/ssh/sshd_config.d/

Hardening guides often set a list such as KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org. We tested that too: it forces classical key exchange. The simplest fix is to delete the line and let OpenSSH use its defaults. If you want to keep an explicit list, use the one for your version:

OpenSSH 9.9 or newer:

KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com,curve25519-sha256

OpenSSH 9.0 to 9.8: the mlkem name does not exist yet, so leave it out.

KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256

3. Test, then restart, with your session still open

sudo sshd -t && sudo systemctl restart ssh

No output from sshd -t means the config is valid. If it prints Bad SSH2 KexAlgorithms, your OpenSSH is too old for a name in your list: fix it before restarting. On some systems the service is called sshd rather than ssh.

4. Confirm from your own computer

Open a new terminal, keeping the old session open, and run:

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

It shows the method your connection actually used. Both ends matter: the connection uses the first method that your computer and your server both support, so an old SSH client on your laptop can pull a modern server back to classical. Update your client too.

Tested 3 December 2026: OpenSSH 9.6 (Ubuntu 24.04) defaults, a curve25519-only config and an mlkem config, and OpenSSH 10.2 (Ubuntu 26.04) defaults. A Kexwatch SSH check is coming soon.