Hardening My Servers for the Post-Quantum Cryptography Push

Hey everyone,

If you have been anywhere near tech or security news over the last 48 hours, you probably saw the wave of post-quantum cryptography (PQC) warnings drop all at once:

When the NSA, CISA, the major cloud providers, and the frontier AI labs all stand up on the same week and say "accelerate your PQC migration now," it is worth paying attention.

It is not a reason to panic and burn down your servers at 2 AM. Nobody is burning a state-level or frontier-AI cryptanalytic breakthrough to read my mail or poke at my game server today.

Still, Filippo's read between the lines was clear enough to act on: 256-bit elliptic curves (P-256, Curve25519 / X25519 / Ed25519) were conspicuously left off even the interim stopgap lists, while RSA-3072/4096 and ECDSA P-384 remain acceptable stopgaps, and ML-KEM / ML-DSA are the real destination.

So instead of worrying about it in the abstract, I sat down, audited my workstation and the four production boxes I run (my mail server, my two web/app nodes, and the Moon server), and tightened everything I could in one clean pass.


Step 1: Audit Before Touching Anything

Before changing a single config file, I checked what each machine was actually negotiating over the wire: OS, OpenSSH, OpenSSL, Caddy, Postfix, Dovecot, and my SSH keys. If you want to check your own servers, two quick commands tell you almost everything you need to know:

screenshot-20261203-093722.png

# Check negotiated SSH key exchange and host key (bypassing ControlMaster)
ssh -vv -o BatchMode=yes -o ControlMaster=no -o ControlPath=none your-server true 2>&1 \
  | grep -E 'Remote protocol|kex: algorithm|Server host key'

# Check negotiated TLS 1.3 group and certificate signature on HTTPS
openssl s_client -connect example.com:443 -servername example.com -brief </dev/null

Honestly, the baseline was better than I expected:

  • My desktop is on Debian forky/sid with OpenSSH 10.6p2 and OpenSSL 3.6.5.
  • All four production servers are already on Ubuntu 26.04.1 LTS with OpenSSH 10.2p1 and OpenSSL 3.5.5.
  • Every SSH session from my desktop to all four servers was already negotiating mlkem768x25519-sha256 (hybrid post-quantum key exchange) out of the box.
  • Dovecot (IMAPS on port 993) on the mail server was already negotiating TLS 1.3 + X25519MLKEM768.
  • Two of my web nodes were already running modern Caddy v2.11.x, which speaks X25519MLKEM768 by default.

That left four real, concrete gaps to close:

  1. Two servers were still on ancient Caddy 2.6.2 (from Ubuntu's old universe package), which predates Go's hybrid ML-KEM support by years.
  2. Postfix on the mail server had an older default tls_eecdh_auto_curves list, so SMTP STARTTLS (ports 25 and 587) was only negotiating plain X25519 even though its OpenSSL 3.5.5 supported X25519MLKEM768.
  3. All of my TLS leaf certificates (both Certbot on the mail server and Caddy across the web boxes) were still using P-256 (ecdsa_secp256r1).
  4. My default SSH key everywhere was a 256-bit ECDSA (P-256) key.

Nothing catastrophic. Just normal accumulated infra drift, and all four were easy to fix cleanly.


Step 2: Upgrading Caddy on the Lagging Nodes

First up were the two servers still running Caddy 2.6.2 (my mail server and Moon). Moving them onto the official Caddy repo brought both up to Caddy v2.11.9.

A quick openssl s_client probe afterward confirmed both immediately switched to:

Protocol version: TLSv1.3
Negotiated TLS1.3 group: X25519MLKEM768

Then, across all four servers, I added a global options block to /etc/caddy/Caddyfile so future certificate renewals automatically step up from P-256 to ECDSA P-384 as an interim stopgap until Let's Encrypt and ACME roll out ML-DSA certs:

{
    key_type p384
}

Validated every config and reloaded Caddy, and every box stayed green:

sudo caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
sudo systemctl reload caddy

Step 3: Enabling Hybrid PQC in Postfix & Rotating Mail Certs

Dovecot was already doing X25519MLKEM768, which meant IMAP was in great shape. Postfix, however, was still falling back to plain X25519 because its default curve list didn't include X25519MLKEM768.

One command fixed both inbound (port 25) and submission (port 587) SMTP:

sudo postconf -e 'tls_eecdh_auto_curves = X25519MLKEM768 X25519 X448 secp384r1 prime256v1 secp521r1'
sudo postfix reload

Next, I rotated the mail server's Let's Encrypt certificate from P-256 to ECDSA P-384 (secp384r1) via Certbot: dry-run first, then live renewal, then reloaded Postfix and Dovecot:

# Test renewal first
sudo certbot certonly --cert-name mail.thecrazygm.com --webroot -w /var/www/certbot \
  -d mail.thecrazygm.com --key-type ecdsa --elliptic-curve secp384r1 --dry-run

# Issue the P-384 cert and reload mail services
sudo certbot certonly --cert-name mail.thecrazygm.com --webroot -w /var/www/certbot \
  -d mail.thecrazygm.com --key-type ecdsa --elliptic-curve secp384r1 --force-renewal
sudo systemctl reload postfix dovecot

# Verify IMAPS (993) and SMTP STARTTLS (587 / 25)
openssl s_client -connect mail.thecrazygm.com:993 -brief </dev/null
openssl s_client -connect mail.thecrazygm.com:587 -starttls smtp -brief </dev/null

Re-probing ports 993, 587, and 25 afterward gave a clean sweep across the board:

PortServiceProtocolKey ExchangeCertificate Signature
993IMAPS (Dovecot)TLSv1.3X25519MLKEM768ecdsa_secp384r1_sha384
587Submission (Postfix)TLSv1.3X25519MLKEM768ecdsa_secp384r1_sha384
25SMTP (Postfix)TLSv1.3X25519MLKEM768ecdsa_secp384r1_sha384

Step 4: Rotating My SSH Key (Without Locking Myself Out)

Ubuntu 26.04's OpenSSH 10.2p1 doesn't yet support the newer ssh-mldsa44-ed25519 hybrid user keys that Debian's OpenSSH 10.6 has, so ECDSA P-384 is the right universal stopgap for now.

The rule for rotating SSH keys is simple: add first, test explicitly, never burn your bridge until you're sure. I still have other boxes I touch occasionally, so I didn't delete my old local key. Instead, I generated a fresh ~/.ssh/id_ecdsa_p384, deployed it to all four servers, verified explicit P-384 authentication, and updated ~/.ssh/config to try the P-384 key first while keeping the old keys as fallbacks for un-migrated hosts.

One subtle gotcha worth sharing: even after putting id_ecdsa_p384 first in ~/.ssh/config, OpenSSH still offered the old P-256 key first because it was loaded earlier in ssh-agent. Reloading ssh-agent with the P-384 key first fixed it immediately, and fresh handshakes now negotiate mlkem768x25519-sha256 and authenticate with the P-384 key:

# Generate a new ECDSA P-384 key (leave old keys untouched)
ssh-keygen -t ecdsa -b 384 -f ~/.ssh/id_ecdsa_p384 -C "user@desktop-p384"

# Deploy and test explicitly before editing ~/.ssh/config
ssh-copy-id -i ~/.ssh/id_ecdsa_p384.pub your-server
ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ecdsa_p384 your-server hostname

# Reload ssh-agent so the P-384 key is offered first
ssh-add -D && ssh-add ~/.ssh/id_ecdsa_p384 ~/.ssh/id_ecdsa

Bonus Side Quest: Fixing My Annoying Hanging SSH Terminals

While inspecting ~/.ssh/config and testing fresh handshakes, I also finally solved a minor annoyance that had been bugging me for months: whenever I had two terminals SSH'd into the same server, closing the first terminal would hang until the second one disconnected.

Turns out I had ControlMaster auto enabled without ControlPersist. The first terminal owned the shared socket and refused to exit while any other terminal was piggybacking on it.

I could have added ControlPersist 5m, or just removed ControlMaster and let every terminal own its own independent SSH session. I chose the latter. I will happily pay an extra 200ms on login to never have a terminal refuse to close again.


The Takeaway

Most of the internet's transition to post-quantum cryptography is going to happen quietly through OS, OpenSSL, OpenSSH, and browser updates, as long as you actually keep your stacks current.

For a small operator, you don't need to panic, and you don't need a massive enterprise roadmap. A calm afternoon of checking what you're actually negotiating over the wire (updating stale web servers, adding X25519MLKEM768 to Postfix, and nudging leaf certs and SSH keys off P-256 to P-384) puts you miles ahead of the curve while we wait for ML-DSA certificates and OpenSSH ML-DSA keys to finish rolling out across distros.

Nothing broke. Everything stayed online. Boring success is still the best kind of sysadmin day.

As always,
Michael Garcia a.k.a. TheCrazyGM

0.55228331 BEE
3 comments

I don't fully understand what you are doing, but I understand enough to say thank you... Hive is more secure having people who DO fully understand!

0.00883367 BEE

I am so glad I'm on your team! Thanks for staying on top of this stuff and helping me understand

!PIMP
!PAKX
!PIZZA

0.00000000 BEE

View or trade PAKX tokens.

@ecoinstant, PAKX has voted the post by @thecrazygm. (1/2 calls)



Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.

0.00000000 BEE

PIZZA!

$PIZZA slices delivered:
@ecoinstant(1/20) tipped @thecrazygm

Learn more at https://hive.pizza.

0.00000000 BEE