OpenSSH supports a number of cryptographic key agreement algorithms considered to be safe against attacks from quantum computers. We recommend that all SSH connections use these algorithms.
OpenSSH has offered post-quantum key agreement (KexAlgorithms)
by default since release 9.0 (April 2022), initially via the
sntrup761x25519-sha512 algorithm. More recently, in OpenSSH 9.9,
we have added a second post-quantum key agreement mlkem768x25519-sha256
and it was made the new default scheme in OpenSSH 10.0 (April 2025).
To encourage migration to these stronger algorithms, OpenSSH 10.1 will warn the user when a non post-quantum key agreement scheme is selected, with the following message:
** 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
This warning is displayed by default but may be disabled via the WarnWeakCrypto option in ssh_config(5).
A quantum computer (QC) is a device capable of performing computations with information encoded as quantum states. Such a device could quickly solve particular problems that are intractable for existing "classical" computers.
The mathematics that underpin a number of cryptographic algorithms are among the problems that quantum computers are believed to be able to effectively solve. This means that a sufficiently-powerful quantum computer (a.k.a a "cryptographically-relevant" quantum computer) will be able to break them. Most affected is the cryptography used for key agreement and digital signatures, both of which play important roles in SSH.
Fortunately, quantum computers of sufficient power to break cryptography have not been invented yet. Estimates for when a cryptographically-relevant quantum computer will arrive, based on the rate of progress in the field, range from 5-20 years, with many observers expecting them to arrive in the mid-2030s.
The entire privacy of an SSH connection depends on cryptographic key agreement. If an attacker can break the key agreement then they are able to decrypt and view the entire session. The attacker need not perform this attack in real time; they may collect encrypted SSH sessions now and then decrypt them later once they have access to a quantum computer. This is referred to as a "store now, decrypt later" attack (also as "harvest now, decrypt later").
Fortunately, improved "post-quantum" cryptographic algorithms have been devised that rely on different underlying mathematical problems that are understood to not be attackable by a quantum computer.
OpenSSH has supported post-quantum key agreement to prevent "store now, decrypt later" attacks for several years and it has been the default since OpenSSH-9.0, released in 2022.
mlkem768x25519-sha256 and
sntrup761x25519-sha512
sntrup761x25519-sha512 and versions 9.9 and greater support
mlkem768x25519-sha256. If your server is already running one of these
versions, then check whether the KexAlgorithms option has disabled
their use.
Match host unsafe.example.com
WarnWeakCrypto no-pq-kex
mlkem768x25519-sha256 combines ML-KEM, a
post-quantum key agreement scheme, with ECDH/x25519, a classical key agreement
algorithm that was formerly OpenSSH's preferred default. This ensures that the
combined, hybrid algorithm is no worse than the previous best
classical algorithm, even if the post-quantum algorithm turns out to be
completely broken by future cryptanalysis.