My SSH Hardening Config on Debian
How SSH is vulnerable to post-quantum era attacks
If you’re anything like me, then you probably rely on SSH a lot.
If you’ve recently (since OpenSSH 10.1, circa 2022) logged into an older host or a host that only supports algorithms that may soon be broken by quantum computing, you may have seen this 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.htmlThat OpenSSH page provides some really useful information on why this matters. In short, Quantum computers may soon be able to infer a private key based on a public key, since the classical RSA / elliptic curve algorithms are especially prone to the algorithms like Shor’s Algorithm.
The horizon for the time that quantum computers are able to smash through certain types of private keys seem to creep ever closer, and because of that, bad actors are storing any encrypted data they can find, in order to decrypt it later.
This could include anything that you have communicated over a protected link. Documents, passwords, other private keys, etc.
Are things about to escalate?
I don’t have a crystal ball, but I don’t think there’s any reason to panic. Earlier this week, the NSA published an advisory to transition to post-quantum cryptography, citing AI as another potential threat. Although, it seems like there’s nothing really in either the AI world or the quantum computing world that actually poses any significant threat right now. I came across this Emerald Book article which does a good job of explaining the current situation.
Better to deal with this now, than later
It seems easy enough to protect against harvest-now-decrypt-later attacks, so one might as well.
I checked my SSH server using a web utility called sshaudit.com – I have a fairly vanilla SSH config, with no additional config that should weaken my security. So I was a bit surprised when I got a big red F as a result:

Some of the reasoning behind it’s score:


I would take those NIST P-curve penalties with a pinch of salt, since Anthropic did find seeds for those curves, which ended up being simple Unix time-stamps. It seems a little less unlikely that the NSA was involved in choosing a seed or planting a back-door.
For my personal machines, I don’t care too much for extreme backward compatibility. I tend to use the latest Debian release (or unstable) and SSH into similar machines, so I added an SSH config that strips away most of the gunk.
Before making any changes to YOUR ssh config. Be sure to make backups, and especially if it’s a remote machine, that you have some way to get back in if you lock yourself out (rescue mode, remote KVM, temporary ssh reverse tunnel, etc). This isn’t any kind of official Debian advice, but it’s a Works For Me™ config, so please engage your own brain. You might especially have to add another host authentication algorithm, if your keys for authenticating against that host aren’t all ed25519 yet.
I created a file on my ssh host called /etc/ssh/sshd_config.d/00-hardening.conf:
# Use Ed25519 only:
HostKeyAlgorithms ssh-ed25519
# Use hybrid post-quantum key exchange algorithms:
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com
# Use 128-bit-or-better tags and encrypt-then-MAC:
MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.comOn my hetzner nodes deployed with their Debian image, I found that the following line wasn’t present in /etc/ssh/sshd_config, so I had to add it:
Include /etc/ssh/sshd_config.d/*.confI restarted sshd, et voila, a big green A:

It deducts 5 points since I have chacha20-poly1305 enabled, which had some risks associated with it that’s already been fixed in Debian ages ago (Terrapin / CVE-2023-48795 / BTS#1059004), so I’m not going to remove it just to appease some online tool.
What about my website or app?
So that’s SSH, you might also be wondering about websites and apps that use TLS.
There’s also a website called “Is my website post-quantum?” where you can enter your domain name for a quick analysis.
Modern browsers and TLS implementations are increasingly adopting ML-KEM for hybrid post-quantum key exchange, which prevents current known harvest-now-decrypt-later attacks.
I wrote this while struggling with the flu for more than a week, so if you find anything that looks like a hideous typo or nonsense, please let me know and I’ll fix it!
