Site icon GetPageSpeed

SSH Warning: “Connection Is Not Using a Post-Quantum Key Exchange Algorithm”

SSH Warning: "Connection Is Not Using a Post-Quantum Key Exchange Algorithm"

You upgraded your laptop, opened an SSH session to a server you have used for years, and got this before the prompt:

** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html

Nothing is broken and nobody has logged in as you. The warning comes from your client, and it tells you one thing: the key exchange that protects this session is classical only. This article explains what that means, which servers trigger it, how to fix it per distribution, and when silencing it is the honest choice.

This is a dated record, written on 2026-12-06. Every result below was measured that day; the sources are linked.

Why the warning appeared now

OpenSSH 10.1 added it. From the release notes:

ssh(1): add a warning when the connection negotiates a non-post quantum key agreement algorithm. This warning has been added due to the risk of “store now, decrypt later” attacks.

Your server did not change. Your client did: current macOS ships OpenSSH 10.5p1, and Homebrew and rolling Linux distributions are on 10.x too. The first SSH session to an older server shows the warning.

The timing made it louder. On 2 December 2026 the National Cyber Director, NSA and CISA asked industry “to expeditiously upgrade our digital infrastructure” in a joint statement, and Anthropic and OpenAI said their models had found “weaknesses in some of the cryptography that protects the internet”. Admins who ignored the warning for months are now searching for it.

What “store now, decrypt later” means for SSH

Every SSH session starts with a key exchange. Both sides agree on a secret, and that secret encrypts everything after it: your commands, file transfers, database dumps over a tunnel, passwords typed into sudo.

curve25519-sha256, the default on most servers for a decade, is strong today. But someone who records the encrypted session can keep it and decrypt it on the day X25519 falls, whether to a quantum computer or to a mathematical result like the ones announced this month. The session you open today is only as safe as its key exchange will be in ten years.

A hybrid post-quantum key exchange fixes that. mlkem768x25519-sha256 (OpenSSH 10.0’s default) and the older sntrup761x25519-sha512 run a classical X25519 exchange and a post-quantum one together. An attacker must break both.

Two things the warning is not about:

Check what your connection negotiates

From the client:

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

curve25519-sha256, ecdh-sha2-* or diffie-hellman-* means classical. mlkem768x25519-sha256 or sntrup761x25519-sha512 means post-quantum hybrid.

On the server, see what sshd offers:

sudo sshd -T | grep -i ^kexalgorithms

SSH picks the first method in the client’s list that the server also supports. A modern client lists the post-quantum methods first, so if the server supports any of them, you get one and no warning.

Which servers trigger the warning

We connected with an OpenSSH 10.6p1 client (Homebrew, macOS) to each stock server in a clean container on 2026-12-06, with no configuration changes:

Server OpenSSH package Negotiated key exchange Warning
CentOS 7.9 7.4p1-23.el7_9 curve25519-sha256 Yes
Rocky Linux 8.10 (RHEL 8) 8.0p1-35.el8_10 curve25519-sha256 Yes
Rocky Linux 9.9 (RHEL 9), DEFAULT policy 9.9p1-17.el9_9 curve25519-sha256 Yes
Rocky Linux 9.9, DEFAULT:PQ policy 9.9p1-17.el9_9 mlkem768x25519-sha256 No
Rocky Linux 10.3 (RHEL 10) 9.9p1-34.el10_3 mlkem768x25519-sha256 No
Ubuntu 22.04 8.9p1-3ubuntu0.18 sntrup761x25519-sha512@openssh.com No
Debian 12 9.2p1-2+deb12u10 sntrup761x25519-sha512 No

The Red Hat family is where the warning lives. Ubuntu and Debian ship an OpenSSH that has supported sntrup761x25519 since version 8.5, so a modern client finds it. RHEL 9 compiles ML-KEM in but its DEFAULT crypto policy leaves it out. RHEL 8 and CentOS 7 have no post-quantum key exchange in their OpenSSH at all.

Fix it on the server

RHEL 10, Rocky Linux 10, AlmaLinux 10

Nothing to do. mlkem768x25519-sha256 is first in the default list. If you still see the warning, a hardening guide probably replaced KexAlgorithms in /etc/ssh/sshd_config or /etc/ssh/sshd_config.d/. Remove that line, or put mlkem768x25519-sha256 at the front of it.

RHEL 9, Rocky Linux 9, AlmaLinux 9

Switch on the post-quantum crypto subpolicy (RHEL 9.7 and later):

sudo update-crypto-policies --set DEFAULT:PQ
sudo systemctl restart sshd

Keep your current session open and test a new connection from a second terminal before you log out. On our Rocky Linux 9.9 test server the offered list then started with mlkem768x25519-sha256, and the warning was gone. The same policy also turns on ML-KEM for TLS in system OpenSSL, so check other TLS clients and services after the switch.

If you run a custom policy such as FUTURE or DEFAULT:SHA1, append :PQ to it instead of replacing it.

RHEL 8, Rocky Linux 8, AlmaLinux 8

OpenSSH 8.0p1 has no hybrid key exchange, and no crypto policy can add one. The supported fix is moving the host to EL9 or EL10. Until then, use the jump-host setup below.

CentOS 7

OpenSSH 7.4p1 is in the same position, and CentOS 7 itself has been end-of-life since June 2024. Your choices are a migration to EL9 or EL10, or a post-quantum jump host in front of the box. Either way, the SSH server you keep running in the meantime should at least get security fixes: the stock 7.4p1 build stopped receiving them with the rest of CentOS 7.

Ubuntu and Debian

Ubuntu 22.04 and later and Debian 12 and later already negotiate sntrup761x25519. If you still get the warning, look for a KexAlgorithms override in sshd_config. Note that sntrup761x25519 is not a NIST algorithm: it protects recorded sessions, but a CNSA 2.0 or FIPS audit will ask for ML-KEM, which arrives with OpenSSH 9.9 and later (Ubuntu 26.04, Debian 13).

Cannot upgrade the server yet? Put a post-quantum jump host in front

For EL7 and EL8 hosts that must stay as they are, route SSH through a bastion that does speak post-quantum key exchange, for example a small EL10 or Ubuntu 24.04 VM in the same network:

# ~/.ssh/config
Host legacy-db
    HostName 10.0.0.15
    ProxyJump bastion.example.com

We tested this with an EL10 bastion and a CentOS 7 target:

debug1: kex: algorithm: mlkem768x25519-sha256
debug1: kex: algorithm: curve25519-sha256
** WARNING: connection is not using a post-quantum key exchange algorithm.

The first line is the leg from your laptop to the bastion, across the internet: post-quantum. The second is the inner session to the CentOS 7 host, which travels inside that tunnel. Someone recording internet traffic sees only the post-quantum outer session. The inner session is classical only on the network between the bastion and the old host, so that segment must be one you trust.

The client still warns, because the inner connection really is classical. That is the one place where silencing the warning per host is justified.

Silencing the warning: do it per host, never globally

OpenSSH lets you turn the warning off with the WarnWeakCrypto option. The ssh_config manual: “Warnings about connections that don’t use a post-quantum key exchange may be disabled using the no-pq-kex flag. no will disable all warnings.”

Do it only for hosts you know about and cannot fix yet, as OpenSSH itself recommends:

# ~/.ssh/config
IgnoreUnknown WarnWeakCrypto

Match host legacy-db,10.0.0.15
    WarnWeakCrypto no-pq-kex

Three details we hit while testing:

  1. Use no-pq-kex, not no. no also hides every future weak-crypto warning OpenSSH adds to this option.
  2. Add IgnoreUnknown WarnWeakCrypto if your config is shared. OpenSSH 10.0 and earlier refuse the whole file: our Debian 13 client (10.0p2) stopped with Bad configuration option: warnweakcrypto and exit code 255. That breaks every SSH connection, including scripts and Ansible.
  3. LogLevel ERROR or QUIET also hides it. Scripts that already set it never show the warning, which is a reason to check kex: algorithm in an audit rather than rely on the message.

Silencing changes nothing about the session. A session to that host is still recordable and still classical. It is a note to yourself that you know, not a fix.

Keep the old SSH server patched while it runs

A host that must keep OpenSSH 7.4p1 for now still needs its known holes closed. Everpatch for CentOS 7 ships security-backported stock packages that upgrade in place, OpenSSH among them. The current openssh-7.4p1-25.el7.everpatch1 covers 17 CVEs, including the Terrapin attack (CVE-2023-48795) and the 2026 scp and forwarding fixes (advisory GPSA-2026-0018):

sudo yum install https://extras.getpagespeed.com/release-latest.rpm
sudo yum update openssh openssh-server openssh-clients
Free to install; commercial production use requires a subscription.

To be clear: these are stock-compatible security updates. They do not add a post-quantum key exchange to OpenSSH 7.4p1, so the warning stays. Pair them with a jump host or a migration plan.

Your SSH sessions are not the biggest recorded stream

SSH is the traffic an admin sees. HTTPS is the traffic everyone else sends: logins, API keys, session cookies, customer data. If your SSH server is classical, the web server on the same host usually is too. Stock NGINX on CentOS 7, RHEL 8, Ubuntu 22.04, Ubuntu 24.04 and Debian 12 links an OpenSSL without ML-KEM, and no configuration line can add it.

NGINX from the GetPageSpeed repository links openssl35, an OpenSSL 3.5 build beside the system library, and negotiates X25519MLKEM768 right after install, CentOS 7 included:

sudo yum install https://extras.getpagespeed.com/release-latest.rpm
sudo yum install nginx    # or: sudo yum update nginx, if the distro NGINX is installed
sudo systemctl restart nginx
Free to install; commercial production use requires a subscription. Without one, a small license notice appears on HTML pages after 30 days.

Then check the result with the GetPageSpeed SSL test. For everything else on the server (databases, VPN, mail, certificates), work through the post-quantum migration checklist for Linux servers.

The short version

Exit mobile version