All insights
·Migration & Engineering·IQCDL

Post-Quantum SSH: Enabling OpenSSH mlkem768x25519 Across Your Estate

How to audit and enable hybrid ML-KEM key exchange in OpenSSH, what still uses classical authentication, and how to roll it out safely.


Post-Quantum SSH: Enabling OpenSSH mlkem768x25519 Across Your Estate

Secure Shell is the administrative channel for most infrastructure: servers, network devices, build runners, backup targets and Git remotes. It is also one of the few protocols where a post-quantum key exchange already ships as the default in mainline software. That makes SSH a practical early win in a migration programme, and a useful test of whether your inventory and change processes actually work.

This article covers what OpenSSH supports, what it does not yet protect, how to audit an estate and how to roll out hybrid key exchange without locking anyone out.

Why SSH belongs early in the migration queue

Confidentiality first, authentication later

The urgent quantum risk for transport protocols is harvest now, decrypt later. An adversary records encrypted traffic today and decrypts it once a cryptographically relevant quantum computer exists. What matters is the key exchange that established the session keys. If that exchange relied only on elliptic-curve Diffie-Hellman, a future Shor-capable machine could recover the session keys from the recorded handshake.

SSH sessions often carry material with a long confidentiality life: administrative credentials typed into a shell, configuration files, database dumps over SFTP, and private keys copied during provisioning. That is the profile Mosca's inequality warns about, and it is why key exchange should come before signatures.

Authentication is different. Forging a signature requires breaking the key at the time of the connection, so there is nothing to harvest retrospectively. Ed25519, ECDSA and RSA authentication are still scheduled for replacement: NIST IR 8547 deprecates them after 2030 and disallows them after 2035. That work can follow the key-exchange change.

The standards behind the protocol

The SSH transport layer is defined in RFC 4253, and the classical curve25519-sha256 method in RFC 8731. The hybrid ML-KEM method is being standardised through the IETF as an Internet-Draft, so the exact name and wire format should be checked against the current draft and your OpenSSH release notes. ML-KEM itself is specified in NIST FIPS 203, and NIST SP 800-227 gives recommendations for using key-encapsulation mechanisms. Combining a classical and a post-quantum shared secret through an approved key-derivation step is consistent with NIST SP 800-56C Rev. 2.

What OpenSSH supports today

OpenSSH has moved in three steps. Each matters for an audit because a given host may be running any of them.

Key exchange method Construction NIST-standardised KEM First in OpenSSH Status
curve25519-sha256 X25519 only No (classical) Long-standing Exposed to harvest-now-decrypt-later
sntrup761x25519-sha512@openssh.com Streamlined NTRU Prime plus X25519 No 8.5 (default from 9.0) Hybrid; default until ML-KEM replaced it
mlkem768x25519-sha256 ML-KEM-768 plus X25519 Yes, FIPS 203 9.9 (default from 10.0) Hybrid; target for NIST-aligned policy

Two points follow from the table.

First, sntrup761 is a respectable hybrid and has protected many sessions since 2022, but it is not a NIST standard. Where policy requires NIST-approved algorithms, mlkem768x25519-sha256 is the method to target.

Second, the hybrid design is deliberate. The shared secrets from X25519 and ML-KEM-768 are combined and hashed, so an attacker must break both to recover the session key. If a flaw were found in a newer ML-KEM implementation, the classical component would still hold against today's adversaries.

What the hybrid method costs

ML-KEM-768 has a 1,184-byte encapsulation key and a 1,088-byte ciphertext. With the 32-byte X25519 values, the client sends a little over 1.2 KB and the server replies with a little over 1.1 KB during key exchange. That is larger than a pure X25519 handshake, but SSH runs over TCP, so the fragmentation problems seen with UDP-based IKEv2 are far less of a concern. Occasionally an old inspecting firewall or a constrained embedded stack mishandles larger key-exchange packets, so test those paths explicitly.

What stays classical

At the time of writing, mainline OpenSSH has no post-quantum host or user key type. Host keys, user keys and SSH certificates remain classical. The symmetric ciphers negotiated afterwards, such as chacha20-poly1305@openssh.com and aes256-gcm@openssh.com, are not the weak point; our guide to AES-256 and Grover's algorithm explains why.

Worked example: auditing a mixed estate

The figures below are illustrative, not survey data. Consider an organisation with 1,000 SSH endpoints in four populations:

  1. 600 Linux servers on a current distribution
  2. 250 Linux servers on a long-term-support release two cycles old
  3. 100 network devices with vendor-supplied SSH stacks
  4. 50 CI runners and automation jobs using client libraries rather than the OpenSSH binary

Step 1: ask the software, not the version string. Distributions backport patches, so a version number can mislead. On each host, run ssh -Q kex. If the output includes mlkem768x25519-sha256, the client binary supports it. For the server, run sshd -T | grep -i kexalgorithms to see the effective configured list.

Step 2: observe what is actually negotiated. Capability is not use. From a representative client, run ssh -v host and look for the line beginning kex: algorithm:. For fleet-wide evidence, raise the server log level where your policy allows and collect the negotiated method, or use passive monitoring of SSH handshakes at a network tap.

Step 3: classify. A plausible result:

Population Count Supports ML-KEM hybrid Action
Current Linux servers 600 Yes Confirm default, monitor
Older LTS servers 250 No (sntrup761 at best) Upgrade OpenSSH or schedule OS upgrade
Network devices 100 Unknown Request vendor roadmap, record as exception
Automation and libraries 50 Depends on library Check library release notes, pin versions

The result is a prioritised list rather than a vague concern. In this example 60 per cent of endpoints need only confirmation, 25 per cent need an upgrade that may already be on the calendar, and 15 per cent need a supplier conversation. Those 150 endpoints belong in your cryptographic bill of materials with an owner and a date.

Rolling out safely

Configure an ordered list

Prefer an explicit, ordered list over relying on defaults, because defaults differ between versions. For example, set KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com,curve25519-sha256 in sshd_config and in the client configuration. Hosts that do not recognise a name should be handled with care: OpenSSH ignores unknown names in some contexts but a typo can still produce an unexpected list, so validate with sshd -t and sshd -T before reloading.

Use configuration management to apply the change in rings: a test group, then internal servers, then jump hosts and bastions, then everything else. Bastions matter most, because they concentrate administrative traffic.

Keep fallback, but measure it

Do not remove curve25519-sha256 on day one. Removing it breaks any client that has not been updated, including embedded tools and old automation. Instead, count how many sessions negotiate a classical method over a few weeks. When that number is small and every remaining source is understood, decide whether to remove classical-only methods or to accept a documented exception. Recent OpenSSH releases also warn interactively when a non-post-quantum method is negotiated, which can help surface stragglers.

Do not forget the keys

While waiting for post-quantum host and user key types, reduce future work. Inventory authorised_keys files and host keys, remove orphaned ones, move long-lived user keys to short-lived SSH certificates where your operating model allows it, and record key algorithm and owner in the same inventory. When post-quantum signature support arrives, you will know what needs replacing and who must act.

Where IQCDL fits

SSH migration is a good test of whether a team can move from awareness to execution. The IQCDL assessment shows where an individual or team stands on cryptographic inventory, protocol migration and governance. Our programmes cover hands-on work with hybrid key exchange and the surrounding change-management skills, and the standards page maps the material to NIST FIPS 203, NIST IR 8547 and related guidance.

Frequently asked questions

Is OpenSSH quantum-safe by default?

For key exchange, recent releases are. OpenSSH 10.0 made the hybrid mlkem768x25519-sha256 method the default, and 9.0 had already defaulted to the hybrid sntrup761x25519-sha512. Authentication is separate: host keys and user keys are still Ed25519, ECDSA or RSA, which NIST IR 8547 deprecates after 2030 and disallows after 2035.

Does hybrid ML-KEM in SSH satisfy CNSA 2.0?

Not on its own for National Security Systems. CNSA 2.0 specifies ML-KEM-1024, whereas the OpenSSH method uses ML-KEM-768 combined with X25519. Organisations subject to CNSA 2.0 should check current guidance and their vendor roadmap before assuming conformance.

Will enabling post-quantum key exchange break older SSH clients?

Not if you keep a classical method such as curve25519-sha256 in the server list. Client and server select the first mutually supported method, so older clients fall back to classical key exchange. The risk is silent fallback, so log negotiated algorithms and remove classical methods only once you know what your clients support.

Do I need to replace my SSH keys now?

Not for harvest-now-decrypt-later protection. That risk concerns session confidentiality, which key exchange addresses. Authentication keys matter for the later move to post-quantum signatures, so for now inventory them, remove stale ones and shorten their lifetimes where you can.