← Back to section · Tutorials & Labs
Deployment in Practice: Configuring and Verifying OpenSSH Post-Quantum Key Exchange
OpenSSH has enabled the sntrup761 hybrid exchange by default since 9.0 and added an ML-KEM hybrid group in 9.9. This article covers version checks, explicit configuration, log-based verification, and safe fallback.
SSH is the operations channel, and a high-value target for harvest-now-decrypt-later attacks: session traffic recorded today can be decrypted once quantum computers mature. The goal of this article is to switch OpenSSH key exchange to post-quantum hybrid algorithms, pin it there, and keep a controlled fallback path. The good news is that most of this journey is already done in the OpenSSH ecosystem; what remains is mostly checking and explicit configuration rather than building from scratch.
Prerequisites: The Version Decides Your Options
Check the version and supported list on both server and client:
sshd -V 2>&1; ssh -V 2>&1
ssh -Q kex | grep -E "sntrup|mlkem"
The factual baseline (per official OpenSSH release records): from 9.0 (April 2022), sntrup761x25519-sha512 became the default-enabled key exchange algorithm — note it is a hybrid of NTRU Prime and X25519; ML-KEM was not yet finalized at the time, and OpenSSH chose the scheme that could ship first. Version 9.9 (September 2024) added mlkem768x25519-sha256; from 10.0 (April 2025) the ML-KEM hybrid group became the preferred option, and clients print a warning banner about connections not using a post-quantum key exchange algorithm when they negotiate a non-PQ algorithm. If your version is below 9.0, the correct action is to upgrade OpenSSH itself — do not look for third-party patches. If your distribution trimmed the algorithm list (some hardened images change defaults), trust the local output of ssh -Q kex.
Steps: Declare the Algorithm Order Explicitly
In /etc/ssh/sshd_config, write the key exchange list explicitly, hybrid groups first and classical groups as fallback:
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256,ecdh-sha2-nistp256
If the version does not support ML-KEM, drop the first entry. After editing, validate syntax with sshd -t, then reload gracefully (systemctl reload sshd). Before reloading, keep one already-logged-in session open, and test a fresh login in a new window first — this is the universal discipline for all SSH configuration changes, unrelated to post-quantum, but it applies here in full. On the client side, you can write the same KexAlgorithms line in ~/.ssh/config for critical hosts to pin both ends; for a fleet-wide rollout, push the line as a baseline with configuration management (Ansible and the like) and record each machine’s OpenSSH version matrix.
A Common Misconception: Configuring the Server Does Not Mean the Fleet Is Done
The most likely illusion during rollout is treating completed server configuration as completed migration. SSH key exchange is the intersection of both sides’ proposals, selected by priority: if the client’s proposal list has no hybrid algorithm, or the client ranks a classical algorithm first and the server allows client preference, the result is still a classical algorithm. OpenSSH defaults share the same order on both sides, so two new versions align naturally; the problem appears precisely in mixed-version environments — new admin machines against old managed machines, or the reverse. So the rollout order has a hidden rule: survey the version distribution of the connecting side first (jump hosts, automation platforms, engineer workstations), then touch the servers, or your logs will show plenty of “configured but not negotiated.” Also note that bastion recording and auditing systems that implement the SSH protocol stack themselves count as “clients” too; check their algorithm support separately instead of assuming they follow the system ssh.
Verification: Look at Negotiation Results, Not Config Files
A config file proves intent; negotiation logs prove fact. Connect once in debug mode:
ssh -vv host 2>&1 | grep -i "kex: algorithm"
The output should show kex: algorithm: mlkem768x25519-sha256 (or the sntrup group). The server can also temporarily enable LogLevel VERBOSE and confirm the actual negotiation distribution of bulk sessions from the auth log. Another low-cost signal is the warning banner of 10.0+ clients: connecting to a not-yet-upgraded server explicitly warns about a non-post-quantum connection — walk a new client through your host list, record which hosts still warn, and that is your upgrade backlog.
Fleet Rollout: From One Machine to a Fleet
A single machine’s configuration is only the template; real deployment happens at fleet scale. Suggested order: upgrade jump hosts and operations entry points first — all operations traffic passes through them, so pinning the harvest risk there yields the most; then core servers and database hosts; finally edge and legacy devices. Before each batch, pull a version matrix from your configuration management facts and mark which machines are below 9.0 (need an OpenSSH upgrade first), which are on 9.0–9.8 (sntrup available), and which already have ML-KEM. For devices whose version truly cannot move (vendor-firmware-locked network gear, management ports of old storage arrays), do not force it: register them as exceptions and evaluate compensating controls — move them into a dedicated management segment, restrict reachable sources, shrink exposure beyond session keys. Review the exception list regularly and strike devices off as they retire. Client versions matter equally: negotiation is decided by both sides, so check the workstations of the operations team and the libraries automation scripts rely on (Ansible, Fabric, and similar tools call the system ssh or paramiko-style libraries underneath); an old library will still negotiate a classical algorithm against an upgraded server while both sides’ logs look “normal.” Fleet acceptance is therefore not “configuration pushed” but sampled negotiation logs confirming the hybrid share has reached its target.
Fallback and Boundaries
Fallback is reverting KexAlgorithms to the original list and reloading — stateless, effective in seconds. Two boundaries must be stated clearly. First, this article solves the quantum resistance of key exchange only — the future decryption risk of recorded traffic. Host keys (such as ed25519) and user public-key authentication remain classical signatures; OpenSSH has adopted no post-quantum signature replacement, so do not touch authentication configuration in pursuit of “fully post-quantum.” Second, a few very old SSH clients (embedded devices, legacy toolchains) may not even know the sntrup group; keeping classical groups like curve25519-sha256 in the list is the door left open for them. Once those devices retire, remove the classical groups from the list to finish the job.
Tags: OpenSSHSSHML-KEMDeployment