{"slug": "i-deleted-all-my-ssh-keys-again", "title": "I deleted all my SSH keys again", "summary": "The U.S. National Security Agency released an advisory calling for an immediate transition to post-quantum cryptography, citing disclosures from frontier AI companies about discoveries that impact the security of cryptographic systems currently in use. The advisory states that \"adversaries are already collecting encrypted information to decrypt once the capabilities become available,\" and, per Filippo Valsorda, endorses the X25519MLKEM768 hybrid key exchange against its previous recommendations. The author is cycling SSH keys again because the ed25519 keys migrated to YubiKeys, TPMs and Apple's Secure Enclave last month are not post-quantum ready, and OpenSSH 10.6 is required for the standardized ssh-mldsa44-ed25519 algorithm.", "body_md": "# I deleted all my SSH keys... again\n\n[security](https://blog.infected.systems/tags/security)\n\nIn some rather unfortunate timing, I [chose last month](https://blog.infected.systems/posts/2026-11-03-i-deleted-all-my-ssh-keys/) to migrate all of my SSH keys to use ones stored in YubiKeys, TPMs, or Apple’s Secure Enclave.\n\nThese are all non-quantum-safe `ed25519` keys.\n\n## Today’s NSA post-quantum advisory\n\nToday the NSA [released an advisory](https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4662430/nsa-advises-immediate-transition-to-post-quantum-cryptography-to-protect-nation/) recommending an *immediate* transition to post-quantum cryptography.\n\nThere are some interesting parts to this advisory that stand out from previous generic PQC recommendations.\n\nFirstly, the NSA are referencing *specific* disclosures directly affecting current crypto systems:\n\nFrontier [AI] companies have engaged with the U.S. government to responsibly disclose recent discoveries that impact the security of some cryptographic systems currently in use. This threat, alongside the existing concerns about quantum computing, presents a significant threat to cryptographic systems protecting sensitive information.\n\nThough it hints at more of a store-and-decrypt attack rather than immediately available capability:\n\nAdversaries are already collecting encrypted information to decrypt once the capabilities become available.\n\nBut since this advice is a bit of a shift from what the NSA has previously recommended – and thinking about how slow standards like FIPS are to update to newer algorithms – this feels quite out of character. As Filippo Valsorda [notes](https://words.filippo.io/nsa-advisory/):\n\nThe NSA wants you to move to PQC *in such a rush* that it’s saying explicitly, against all its previous recommendations, that you can use the X25519MLKEM768 hybrid key exchange since it’s the most widely available solution.\n\nSo it seems like this is an advisory it would be wise to take seriously.\n\n## Post-quantum SSH\n\nUnfortunately all of the keys I minted using my hardware enclaves as part of the previous post are not PQC-ready. Yubico [currently have YubiKeys with PQC in private beta](https://www.yubico.com/pqc-beta-program/) but I don’t think they’re going to be generally available until next year.\n\nRecent versions of OpenSSH support post-quantum crypto for key exchange using traditional on-disk keys for now though.\n\nI guess it’s time to cycle all my keys again.\n\n## A note on OpenSSH versioning\n\nNote that following along with this **requires at least OpenSSH 10.6**. I’ve tested this on Alpine Edge and Fedora 45, but you may struggle on slower moving distributions. I need to work out what to do about my FreeBSD, macOS and Debian hosts.\n\nOpenSSH technically added experimental support for post-quantum `ML-DSA-44` keys in 10.4 under the name `ssh-mldsa44-ed25519@openssh.com`, and some guides online still reference this name.\n\nThe name was standardised as `ssh-mldsa44-ed25519` (no suffix) in 10.6, but OpenSSH seems to treat these as two separate algorithms so, for example, a macOS 27 client running 10.5 which is only aware of `ssh-mldsa44-ed25519@openssh.com` cannot auth to a Fedora 45 server running 10.6 which is only aware of `ssh-mldsa44-ed25519`.\n\nI don’t think there’s any solution to this beyond waiting for your distro to upgrade to 10.6, or installing OpenSSH 10.6+ manually.\n\n### Client: Generate and enable PQC key\n\nWe can generate a key which layers the existing classical `ed25519` protection with post-quantum resistant `ML-DSA-44`.\n\n```\nssh-keygen -t mldsa44-ed25519 -f ~/.ssh/id_mldsa44-ed25519\n```\n\nAfter this, we are left with a public key in a `id_mldsa44-ed25519.pub` file in the location we specified with `-f`. We can use this with `ssh-key-add` or add it directly to `authorized_keys` on a destination host.\n\nIn the future, I’m sure PQC keys will “just work” with OpenSSH but for now I had to be quite explicit about wanting to use the key, and about allowing the server to use PQC also, adding these lines to my `~/.ssh/config`:\n\n```\nHost blog.infected.systems\n    IdentityFile ~/.ssh/id_mldsa44-ed25519\n    PubkeyAcceptedAlgorithms ^ssh-mldsa44-ed25519\n```\n\n### Server: Generate PQC key\n\nGenerating a PQC client key doesn’t automatically mean it can be used when connecting to our server, as OpenSSH still does not automatically generate `mldsa44-ed25519` host keys yet.\n\nWhen trying to SSH into a stock Fedora 45 host, I get:\n\n```\ndebug1: Skipping ssh-mldsa44-ed25519 key /home/user/.ssh/id_mldsa44-ed25519 - corresponding algorithm not in PubkeyAcceptedAlgorithms\n```\n\nTo resolve this, we can generate a `mldsa44-ed25519` host key on the SSH server:\n\n```\nssh-keygen -t mldsa44-ed25519 -f /etc/ssh/ssh_host_mldsa44_ed25519_key -N \"\"\n```\n\nThe `-N` above stands for **N** ew Passphrase and is blank since we want to generate a key for unattended server authentication.\n\n### Server: Enable PQC keys\n\nWe still need to tell the OpenSSH server to use the PQC host key we just generated. Create an SSH server drop-in config with:\n\n```\nnano /etc/ssh/sshd_config.d/00-pqc.conf\n```\n\nIn this file, we can now enable `ML-DSA-44` as an offered algorithm in `HostKeyAlgorithms`, and specify that we accept `ML-DSA-44` public keys:\n\n```\nHostKeyAlgorithms ^ssh-mldsa44-ed25519\nPubkeyAcceptedAlgorithms ^ssh-mldsa44-ed25519\n```\n\nNote that the `^` in front of the algorithm name means we’re just *adding* the algorithm to the front of the default list of accepted algorithms rather than overriding the list.\n\nAlso note that the `00-` prefix on the drop-in file is also deliberate. On Fedora/Red Hat systems we want to ensure this file is read before `40-redhat-crypto-policies.conf`.\n\nAfter a restart of the SSH daemon on the server, we ought to be able to connect with the PQC key:\n\n```\ndebug1: Offering public key: /home/user/.ssh/id_mldsa44-ed25519 MLDSA44-ED25519 SHA256:ZAh94rqrTo/r29erDDrAJMmrKhsn0ItigtganJPNswM explicit\ndebug1: Server accepts key: /home/user/.ssh/id_mldsa44-ed25519 MLDSA44-ED25519 SHA256:ZAh94rqrTo/r29erDDrAJMmrKhsn0ItigtganJPNswM explicit\nAuthenticated to blog.infected.systems ([2a11:f2c0:ffcc::beef]:22) using \"publickey\".\n```\n\nWe can also check the server config to ensure the config has applied:\n\n```\nsudo sshd -T | grep -iE '^(hostkey|hostkeyalgorithms|pubkeyacceptedalgorithms)'\n```\n\nIf our changes have worked, this should show `ssh-mldsa44-ed25519` at the start of both the `HostKeyAlgorithms` and `PubkeyAcceptedAlgorithms`. Our new `ssh_host_mldsa44_ed25519_key` ought to be loaded along with the other `HostKey` s. We didn’t need to specify this directly since OpenSSH loads these files using a wildcard and we matched the existing naming scheme when creating the new key.\n\nThis server will now accept authentication using PQC, but will still work as before for any classic keys we were already using.\n\n### Server: Restrict to only PQC keys\n\nBecause of the intensity of the wording in the advisory above, it’s probably a good idea to restrict the server to **only** use PQC.\n\nBefore doing this obviously make sure that you’re happy that **all** of your client devices are capable of PQC-based key auth.\n\nTo do this, we can create the same `00-pqc.conf` file but be a bit more restrictive with the options we choose. Note the lack of `^` before the algorithm names, and the new `HostKey` option which uses a specific path on disk meaning OpenSSH will load *only* the PQC key (overrides the default `HostKey` option, which uses a wildcard to pick up any keys on disk):\n\n```\nHostKey /etc/ssh/ssh_host_mldsa44_ed25519_key\nHostKeyAlgorithms ssh-mldsa44-ed25519\nPubkeyAcceptedAlgorithms ssh-mldsa44-ed25519\n```\n\nThe output of our config debug command before now confirms a single approved `ML-DSA-44`-based auth method for each config option:\n\n``` bash\n$ sudo sshd -T | grep -iE '^(hostkey|hostkeyalgorithms|pubkeyacceptedalgorithms)'\nHostKeyAgent none\nHostKeyAlgorithms ssh-mldsa44-ed25519\nPubkeyAcceptedAlgorithms ssh-mldsa44-ed25519\nHostKey /etc/ssh/ssh_host_mldsa44_ed25519_key\n```\n\nHopefully this helps some folk. I put this post together fairly quickly so if anyone has suggestions or recommendations please do let me know!\n\n### Addendum\n\nI like to add the host keys for SSH servers into DNS as `SSHFP` records. This helps protect against MITM style attacks since SSH uses a trust-on-first-use model for host keys and I switch between a lot of client devices so there’s a lot of “first use”. Unfortunately it doesn’t seem like SSHFP records are supported yet for `ML-DSA-44` host keys.\n\nI also have Caddy in front of this blog handling TLS termination. It does [fully support PQC](https://www.ssllabs.com/ssltest/analyze.html?d=blog.infected.systems&latest) and if your browser is up-to-date you probably are reading this page using `X25519MLKEM768`. But because of limitations in upstream Go crypto libraries, it doesn’t seem possible yet to force Caddy into using *only* PQC. Going PQC-only should be possible in nginx though [based on some of the notes in this guide](https://docs.f5.com/app-delivery/google/quickstart/pqc/).", "url": "https://wpnews.pro/news/i-deleted-all-my-ssh-keys-again", "canonical_source": "https://blog.infected.systems/posts/2026-12-02-i-deleted-all-my-ssh-keys-again/", "published_at": "2026-12-03 16:03:30+00:00", "updated_at": "2026-12-03 16:17:26.444586+00:00", "lang": "en", "topics": ["ai-safety", "ai-policy"], "entities": ["NSA", "OpenSSH", "Filippo Valsorda", "Yubico", "Apple Secure Enclave", "ML-DSA-44", "X25519MLKEM768"], "also_reported_by": [], "takeaway": null, "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/i-deleted-all-my-ssh-keys-again", "markdown": "https://wpnews.pro/news/i-deleted-all-my-ssh-keys-again.md", "text": "https://wpnews.pro/news/i-deleted-all-my-ssh-keys-again.txt", "jsonld": "https://wpnews.pro/news/i-deleted-all-my-ssh-keys-again.jsonld"}}