← All engineering notes
ENGINEERING JOURNAL / FIELD NOTES

How to Upgrade to Post-Quantum SSH Keys with OpenSSH (ML-DSA + Ed25519)

OpenSSH 10.6 introduced support for mldsa44-ed25519, a hybrid of ML-DSA-44 and Ed25519. Use it when rotating the personal SSH key you use to log in to a server. OpenSSH release notes

PUBLISHED / · BY PHIL.ON
post-quantum-ssh-keys-openssh-mldsa

Which SSH keys should you replace?

Current developer keyRecommendation

RSA with ssh-rsa signatures (SHA-1), or DSA (ssh-dss)

Retire these legacy signatures. Use the hybrid key where supported.

Ed25519, ECDSA, or RSA with rsa-sha2-256 / rsa-sha2-512

Rotate to mldsa44-ed25519 when the client and server support it. Keep your working key during the transition.

Hardware-backed ed25519-sk or ecdsa-sk

Keep the hardware key wherever policy requires it until an approved replacement offers both protections.

An RSA public key can start with ssh-rsa even when the client signs with RSA/SHA-2. Check the signature selected during login to tell which it uses. OpenSSH authentication algorithms

1. Check support and generate the new key

Run ssh -V on your laptop and sudo sshd -V on the server. Use current patched OpenSSH releases with hybrid signature support on both sides. In upstream OpenSSH, use 10.6 or later. You can confirm local support with ssh -Q key | grep -Fx ssh-mldsa44-ed25519. Then generate a separate key on your laptop and set a passphrase when prompted.

Bash
ssh-keygen -t mldsa44-ed25519 -f ~/.ssh/id_mldsa44_ed25519
ssh-keygen -lf ~/.ssh/id_mldsa44_ed25519.pub

OpenSSH ssh-keygen manual

2. Add the public key and test a fresh login

Keep a working SSH session open. If you manage a plain authorized_keys file, use the command below. If your old key has restrictions such as from= or command=, have the administrator add the new public key with equivalent restrictions. For centrally managed keys, submit the .pub file through the same access system.

Shell
ssh-copy-id -i ~/.ssh/id_mldsa44_ed25519.pub [email protected]

In a second terminal, open a fresh connection. This test selects the new identity and limits public-key authentication to the hybrid signature.

Shell
ssh -vvv -S none \
  -o IdentitiesOnly=yes \
  -o PubkeyAcceptedAlgorithms=ssh-mldsa44-ed25519 \
  -i ~/.ssh/id_mldsa44_ed25519 [email protected] true

Confirm that the login succeeds, the debug log shows signing with ssh-mldsa44-ed25519, and the accepted key matches the fingerprint printed in step 1. ssh-copy-id manual · OpenSSH client options

3. Switch your default and remove the old key

Update the target’s IdentityFile in ~/.ssh/config to ~/.ssh/id_mldsa44_ed25519. Test your normal login, including any bastion or MFA. Then remove that old public key from the target’s authorized_keys or central access system. Repeat for each target before retiring the old private key.

Teams using SSH certificates should test issuance and CA verification separately. Portable OpenSSH 10.6p2 added the hybrid algorithm to the allowed CA signature list. This walkthrough verifies developer authentication. Check the session key exchange and server host key separately. OpenSSH 10.6p2 release notes

SHARE THIS NOTE

← Back to notes