SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor

Post-Quantum SSH: Wetin Change for Ubuntu?

OpenSSH don dey use hybrid post-quantum key exchange by default, but Ubuntu host keys remain classical. Run commands to see wetin your box really dey use.

Wetin change for post-quantum SSH

Post-quantum SSH don already dey switched on for most people, and nobody need configure am. Current OpenSSH client wey dey talk to current OpenSSH server dey choose hybrid post-quantum key exchange by default. So the session key fit resist attacker wey record your traffic today and decrypt am years from now. The protection dey real, but e no broad reach as the phrase "quantum-safe SSH" fit make person think.

Make we first explain two terms. SSH (secure shell) na the protocol wey you use take log into server. The key exchange, wey people usually write as "kex", na the first step for every SSH connection. The two ends agree on shared secret, and that secret encrypts everything wey follow. The key exchange na the part wey change first. For Ubuntu LTS releases, na still only that part don change.

No trust this page, run the commands

Every algorithm name wey dey below come from command wey you fit run by yourself. Na deliberate thing be that. Default don change more than once across OpenSSH releases, so guide wey person write two years ago fit mention algorithm wey your machine no longer prefer, and e no get way to tell you. Learn these commands, and you no go need articles about this again, including this one.

Start with wetin your build sabi do.

ssh -V
ssh -Q kex

ssh -V dey print version line wey start with OpenSSH_, follow by Ubuntu package suffix and OpenSSL version. ssh -Q kex dey print one key exchange algorithm for each line. For build wey get post-quantum support, you go see names like mlkem768x25519-sha256 and sntrup761x25519-sha512@openssh.com for that list, together with classical names like curve25519-sha256.

Wetin your build support no be wetin e dey offer

Na this difference plenty posts dey skip. ssh -Q kex dey answer one question: wetin this binary fit do. E no answer the question wey concern you: wetin this connection go actually propose. The two lists different, and na the gap between dem old advice dey cause serious damage.

ssh -G example.com | grep -i '^kexalgorithms'
sudo sshd -T | grep -i '^kexalgorithms'

ssh -G <host> dey print the client's effective configuration for that host, after ~/.ssh/config and /etc/ssh/ssh_config don apply. sshd -T dey do the same thing for the server. Each one dey print one kexalgorithms line for preference order, and the first name for that line na that side's first choice. Na that line go enter the wire.

The gap no be theory. OpenSSH 8.5, wey release on 2021-03-03, add sntrup761x25519-sha512@openssh.com and intentionally leave am out of the default list. For that release, ssh -Q kex show the algorithm but ssh -G no show am. This mean say the binary fit do post-quantum key exchange, but no connection go request am unless person add am with a KexAlgorithms line.

Read the algorithm wey your connection negotiate

ssh -v example.com 2>&1 | grep 'kex: algorithm'

Between current client and current server, e go print:

debug1: kex: algorithm: mlkem768x25519-sha256

mlkem768x25519-sha256 na hybrid. E dey run ML-KEM (module-lattice key encapsulation mechanism, wey standardise as FIPS 203) for parameter set 768, together with X25519 elliptic curve Diffie-Hellman, then e mix both outputs enter the session key.

Against older server, you fit see this instead:

debug1: kex: algorithm: curve25519-sha256

That name no get post-quantum half. curve25519-sha256 na elliptic curve Diffie-Hellman by itself, and large quantum computer fit break am. Na this be the full reason why default change.

One negotiation rule explain why one old machine fit hold session back. Client send its list according to preference order, server send its own, and the algorithm wey dem choose na the first name for client's list wey also dey for server list. Client preference win, so the older side among the two decide how far up the list you go. If you upgrade your laptop, e no upgrade session to server wey never hear about ML-KEM.

ssh -v worth knowing for more than this one line, because na the same output wey you go use find Permission denied (publickey) failure when login refuse completely.

Remove the grep and ssh -v to show the rest of the negotiation, including the line wey the next section dey discuss:

debug1: kex: host key algorithm: ssh-ed25519

Which OpenSSH release make the hybrid exchange become the default

The upstream release notes show the sequence clearly. The dates matter pass version numbers, because dem show how long this thing don dey run quietly.

  • 8.5, wey dem release for 2021-03-03, add sntrup761x25519-sha512@openssh.com and leave am disabled by default.
  • 8.9, wey dem release for 2022-02-23, add am to the default list, but behind curve25519-sha256 and the ECDH methods.
  • 9.0, wey dem release for 2022-04-08, turn am on. The notes talk say OpenSSH go "use the hybrid Streamlined NTRU Prime + x25519 key exchange method by default". Na this release make post-quantum key exchange become the normal case.
  • 9.9, wey dem release for 2024-09-19, add mlkem768x25519-sha256 as another option. The same release give the older method the IANA registered name, sntrup761x25519-sha512, so newer builds list am with both spellings.
  • 10.0, wey dem release for 2025-04-09, make mlkem768x25519-sha256 the default for key agreement.
  • 10.1, wey dem release for 2025-10-06, add client warning when connection negotiate key exchange wey no get post-quantum half. The WarnWeakCrypto option inside ssh_config control am, and e dey on by default.
  • 10.6, wey dem release for 2026-10-06, add WarnWeakCrypto to sshd_config too. E dey on by default there as well, and e make the server log clients wey negotiate key agreement wey no be post-quantum.

April 2022 na the date wey make sense to remember. Any pair of machines wey dey run OpenSSH 9.0 or newer with the default algorithm lists don dey use post-quantum key exchange since then, without any configuration and without telling the person wey dey type ssh. A pinned KexAlgorithms line for either end fit still remove am, na why the commands above better pass any version table.

Ubuntu release wey carry am

Ubuntu dey lock OpenSSH version for each release, then e dey backport security fixes into am without changing the version number. So, the Ubuntu release wey you dey run go determine your default algorithm. Check the machine wey dey in front of you with ssh -V instead of trusting list. As of October 2026, archive get these versions:

  • 22.04 LTS carry 1:8.9p1, wey come before the 9.0 default. E default list include sntrup761x25519-sha512@openssh.com, but e dey behind curve25519-sha256 and the ECDH names, so 22.04 client go negotiate curve25519-sha256. 22.04 server still accept the post-quantum exchange from 9.0 or newer client.
  • 24.04 LTS carry 1:9.6p1, wey come after 9.0 and before 9.9, so e default na sntrup761x25519-sha512@openssh.com and e no get ML-KEM.
  • 25.10 carry 1:10.0p1 (last checked for October 2026), and e default na mlkem768x25519-sha256. E reach end of life on 2026-07-09 and e no dey get security updates again, so move any 25.10 box go 26.04 LTS.
  • 26.04 LTS carry 1:10.2p1, wey default na mlkem768x25519-sha256 and e dey warn about connections wey no be post-quantum. E come before 10.4, so e no get post-quantum signature type.
  • 26.10, wey release on 2026-10-15 and get support until July 2027, carry 1:10.5p1. E default na mlkem768x25519-sha256, e dey warn about connections wey no be post-quantum, and na the first Ubuntu release wey carry the experimental post-quantum signature type from OpenSSH 10.4, wey we cover below.

Make we work through real pair of machines. 26.04 laptop connect to 24.04 server. The client's first choice, mlkem768x25519-sha256, no dey inside the 9.6 server list. The client's next post-quantum choice wey the server get na sntrup761x25519-sha512@openssh.com, and na that name ssh -v report. The session use post-quantum key exchange, even though the server build na from 2024, and nobody configure anything.

The 22.04 case show why order of the list matter as much as the things wey dey inside am. OpenSSH 8.9 know the sntrup761x25519-sha512@openssh.com name, so ssh -Q kex for that box list am, and ssh -G list am too, but after curve25519-sha256 and the three ECDH names. Because client preference dey win, 22.04 client go settle on curve25519-sha256 with any server, while the same 26.04 laptop wey connect to 22.04 server still get sntrup761x25519-sha512@openssh.com. The connections wey end up classical na the ones wey server no offer any post-quantum name, like OpenSSH older than 8.9 wey remain on default settings, or server wey get pinned KexAlgorithms line. From OpenSSH 10.1 or newer client, connection like that go show this:

** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.

The warning describe the negotiated connection, and both ends determine am. With your client on default settings, e point to the server wey you dey reach, because your client offer post-quantum names and the server no accept any of dem. If ssh -G <host> | grep -i '^kexalgorithms' show no mlkem or sntrup name, the pin dey your own side instead. Otherwise, the answer na to upgrade the server. Setting WarnWeakCrypto no go remove the message and e no change anything about the connection. If that warning just appear for one of your own connections, the step-by-step fix for the post-quantum warning show how to confirm the negotiated algorithm and make the change for the correct machine.

Why hybrid, and wetin harvest now decrypt later mean

The threat get one clear shape. An attacker wey fit see your traffic go record the encrypted bytes today and store dem. E no fit read dem today. E go keep dem until quantum computer wey big enough to break X25519 dey available, then e go read dem. Dem dey call this harvest now, decrypt later, or store now, decrypt later. E no require any clever move from the attacker now. E only require disk space and patience.

Encryption get this problem, but signatures no get am, and this difference dey drive everything else. Recorded ciphertext go keep value as long as the data wey dey inside am still sensitive. Signature only need remain impossible to forge when dem dey check am. If person break signature algorithm for 2035, e fit impersonate server for 2035. E no mean say e fit go back forge login from 2026. So dem need fix key exchange first, while signature side fit follow later. Na this order upstream use.

Hybrid mean say both algorithms dey run, and both results dey enter the session key. To recover the secret behind mlkem768x25519-sha256, attacker must break ML-KEM 768 and X25519. Dem choose this pairing on purpose: ML-KEM dey much newer than X25519 and cryptanalysts never get as much time attack am. So if dem find flaw for the new algorithm, you no lose the protection wey you already get.

Wetin dey protected and wetin no dey

The key exchange dey protected. The shared secret wey dey encrypt your session come from hybrid exchange, so recording of that session wey person make today no go become readable when quantum computers show.

For 26.04 LTS and older versions, the host key no dey protected. The debug1: kex: host key algorithm: ssh-ed25519 line name classical signature, and rsa-sha2-512 plus the ECDSA (elliptic curve digital signature algorithm) types do the same thing. Attacker wey get working quantum computer fit forge that signature and pretend to be your server, but na only during live connection for that future time, and e no go ever affect traffic wey person record now.

Your login key no dey protected too. The key for ~/.ssh/id_ed25519 na the same kind classical signature, and the same explanation apply. Wetin dey protect that key this year na where e dey and who fit read am. So sensible SSH key management fit reduce your real risk much more than any algorithm name for this page.

Upstream don now start work for the signature side. OpenSSH 10.4, wey release on 2026-07-06, add experimental support for composite signature wey combine ML-DSA 44 with Ed25519, generated with ssh-keygen -t mldsa44-ed25519 and disabled by default. OpenSSH 10.6, wey release on 2026-10-06, enable am as ssh-mldsa44-ed25519. The new name remove the @openssh.com suffix wey the experimental version use, so you need regenerate keys wey you make with 10.4 or 10.5. Like the key exchange, na hybrid, so person wey wan forge am must break both halves. The current ssh_config manual put the plain ssh-mldsa44-ed25519 after ssh-ed25519 for the default host key and public key lists, and ssh-keygen without any -t still dey make Ed25519 key.

For Ubuntu, na only the newest interim release get any of am. 26.04 LTS ship with 1:10.2p1, wey older than 10.4, so the LTS builds no get post-quantum host key type or post-quantum user key type, and ssh-keygen get nothing to offer you. 26.10, wey release on 2026-10-15, ship with 1:10.5p1, and e ssh-keygen manual list mldsa44-ed25519 among the key types, while ed25519 still be the default. Na the experimental version under the ssh-mldsa44-ed25519@openssh.com name, so keys of that type wey you make on 26.10 go need regeneration when you move to release with OpenSSH 10.6 or newer. The 26.10 manuals put that name at the end of the default host key and public key lists, after ssh-ed25519. So with default settings, 26.10 connection still prefer ssh-ed25519. Run ssh -Q key for your machine: if no name wey contain mldsa show, any guide wey tell you to generate one dey describe software wey your machine no get. Because signature only need hold when system dey check am, waiting for LTS release to ship the final version no cost you anything today.

TLS for the same server na separate matter with separate answer. TLS (transport layer security) na wetin your web server speak for port 443, and e dey use different codebase with different release schedule. Upgrading OpenSSH no change anything there. If you dey run a self-signed certificate for a private service on the same VPS, OpenSSL and your web server decide the signature and key exchange, so ask about that stack by itself.

Wetin sensible operator go do now

Keep OpenSSH current, and stop there. Na na the whole strategy for this problem. sudo apt update && sudo apt upgrade keeps you for the version wey your Ubuntu release ships, and na moving go newer Ubuntu release go move you go newer OpenSSH. If you turn on unattended security upgrades, patches go apply without you needing remember am. Building OpenSSH from source just to chase algorithm name no worth the trade-off, because you go lose the distribution security updates for the service wey dey most exposed for the server. If you still fetch source, check the download against its published checksum before you build am.

No write KexAlgorithms line by hand. Na this one action dey reliably make things worse. Hardening guide from 2018 fit give you list wey correct for 2018, but if you paste am inside sshd_config, e go replace the default list instead of adding to am. Every algorithm wey dem invent since then go now dey excluded, so server wey for negotiate mlkem768x25519-sha256 by itself go quietly drop to any one wey remain for the pinned list. Run sudo sshd -T | grep -i '^kexalgorithms' for any server wey you inherit. If that line short pass the one for fresh install of the same release, somebody pin am.

If you get real reason to change the list, add to am instead of replacing am. OpenSSH dey read leading + as append, leading - as remove, and leading ^ as move go front.

KexAlgorithms ^mlkem768x25519-sha256

Test the file before you depend on am. sudo sshd -t dey parse the configuration and print nothing when e valid. KexAlgorithms line wey name algorithm wey the build no get go stop sshd from starting, and for remote box that one mean say you no fit enter again. So keep second session open while you dey work. When the two sides' lists no get any algorithm wey overlap, client go talk am plainly:

Unable to negotiate with 203.0.113.10 port 22: no matching key exchange method found. Their offer: curve25519-sha256,ecdh-sha2-nistp256

Understand "quantum-safe" marketing as claim about one layer. If vendor call product quantum-safe, dem dey describe whichever layer dem name, and that layer usually na key exchange somewhere. Ask for the algorithm name and the protocol wey e apply to. For Ubuntu LTS releases for October 2026, the honest version of the claim be say key exchange hybrid post-quantum, while signatures remain classical. Ubuntu 26.10 carry the experimental hybrid post-quantum signature from OpenSSH 10.4, upstream OpenSSH 10.6 enable am under the final name, and either one only count where both ends run the same version. Anything wider than that suppose come with name wey you fit find for ssh -Q kex or ssh -Q key output.

Continue with the boring parts. Post-quantum key exchange no do anything about password wey person fit guess, or private key wey person copy enter laptop wey dem later steal. Na those things dey actually take servers, and standard SSH hardening on a VPS still carry almost all the weight. If the negotiation steps here no familiar to you, wetin SSH dey do when you connect cover the stages wey this page assume say you know.

FAQ

My SSH connection don already dey post-quantum?

Run ssh -v yourserver 2>&1 | grep 'kex: algorithm' and read the name wey e print. mlkem768x25519-sha256 and sntrup761x25519-sha512@openssh.com na hybrid post-quantum exchanges. curve25519-sha256, ecdh-sha2-nistp256 and any diffie-hellman-group name na classical. Both ends need version wey dey offer post-quantum name, because negotiation dey pick the client's first choice wey the server still support, so the older machine dey set the limit.

Which OpenSSH release make post-quantum key exchange become default?

OpenSSH 9.0, wey release on 2022-04-08, make sntrup761x25519-sha512@openssh.com the default key exchange. OpenSSH 9.9, wey release on 2024-09-19, add mlkem768x25519-sha256, and OpenSSH 10.0, wey release on 2025-04-09, make that one the default instead. OpenSSH 10.1, wey release on 2025-10-06, begin warn when connection negotiate neither of dem. Check wetin your own build dey do with ssh -Q kex and ssh -G <host>, because your Ubuntu release dey decide which ones you get.

I suppose generate post-quantum SSH key?

No be for Ubuntu LTS release, because the OpenSSH wey e get no such key type. 26.04 LTS ship 10.2, and the post-quantum work there cover only key exchange. E no need any key files from you or any configuration. Upstream, OpenSSH 10.4 add experimental key wey combine ML-DSA 44 with Ed25519, and Ubuntu 26.10 ship that experimental version inside its 10.5 package. OpenSSH 10.6, wey release on 2026-10-06, enable am as ssh-mldsa44-ed25519. If both ends dey run 10.6 or newer, ssh-keygen -t mldsa44-ed25519 go make one, and you must regenerate keys from the experimental 10.4 and 10.5 support, including any key wey dem make on 26.10. Everywhere else, continue to use Ed25519 key and protect the place wey you store am.

Why ssh dey warn say my connection no be post-quantum?

OpenSSH 10.1 and newer print ** WARNING: connection is not using a post-quantum key exchange algorithm. when the exchange wey dem negotiate no get post-quantum half. With client wey use default settings, na the server cause am, because your client offer post-quantum names and the server accept none of dem. Run ssh -G yourserver | grep -i '^kexalgorithms' first to rule out pinned list for your own side. Then upgrade the server's OpenSSH, or check whether person pin a KexAlgorithms line inside its sshd_config wey exclude the modern names. Setting WarnWeakCrypto no go hide the message, but the connection go remain exactly as weak as before.

Dis article help you?

#ssh#openssh#post-quantum#cryptography#hardening