Use ML-DSA 44/Ed25519 keys with OpenSSH

mldsa44-ed25519 combines ML-DSA 44 and Ed25519 signatures. Here is how to generate a key pair and configure both sides for public key login.

Check OpenSSH support

On the client:

1ssh -V
2ssh -Q key | grep mldsa44
3ssh -Q sig | grep mldsa44

On the server:

1/usr/sbin/sshd -V
OpenSSH version Algorithm name in configuration Default
Before 10.4 Not supported upstream Unavailable
10.4 / 10.5 [email protected] Disabled
10.6 ssh-mldsa44-ed25519 Allowed

OpenSSH 10.4 introduced experimental support. The 10.6 source includes the new name in the default signature lists. The examples below use 10.6 on both sides.

Check the actual binaries, since vendor builds and backports can differ. No mldsa44 output from ssh -Q means that client cannot use this key type. Upgrade OpenSSH first; configuration cannot add a missing algorithm.

For 10.4/10.5, use the experimental name in configuration instead. When upgrading to 10.6, regenerate experimental keys and replace their public keys: the old algorithm name was removed.

Client: generate the key and configure SSH

1mkdir -p ~/.ssh
2chmod 700 ~/.ssh
3ssh-keygen -t mldsa44-ed25519 \
4  -f ~/.ssh/id_mldsa44_ed25519 \
5  -C "alice@laptop"

Enter a passphrase when prompted. This creates the private key and ~/.ssh/id_mldsa44_ed25519.pub.

Using an existing login method, install the public key on the server:

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

Add this block near the top of ~/.ssh/config, before general Host * settings:

1Host pq-server
2    HostName server.example.com
3    User alice
4    IdentityFile ~/.ssh/id_mldsa44_ed25519
5    IdentitiesOnly yes
6    PubkeyAuthentication yes
7    PubkeyAcceptedAlgorithms +ssh-mldsa44-ed25519

The + appends to the defaults. In stock 10.6, this algorithm is already allowed; the explicit line is useful when documenting the setup. If you already set PubkeyAcceptedAlgorithms, edit that setting rather than adding a competing one. See ssh_config(5).

Inspect the effective client settings:

1chmod 600 ~/.ssh/config
2ssh -G pq-server | grep -Ei '^(identityfile|identitiesonly|pubkeyauthentication|pubkeyacceptedalgorithms) '

Server: accept the user key

Edit the global section of /etc/ssh/sshd_config, before any Match blocks:

1PubkeyAuthentication yes
2PubkeyAcceptedAlgorithms +ssh-mldsa44-ed25519

As on the client, edit an existing algorithm setting if present. Check included configuration files too. These options control user authentication; see sshd_config(5).

For the target account (alice), check permissions:

1# Run as alice on the server
2chmod 700 ~/.ssh
3chmod 600 ~/.ssh/authorized_keys

Keep the current session open. Validate the configuration, inspect the effective settings, then reload:

 1sudo /usr/sbin/sshd -t
 2sudo /usr/sbin/sshd -T \
 3  -C user=alice,host=laptop,addr=192.0.2.10 \
 4  | grep -Ei '^(pubkeyauthentication|pubkeyacceptedalgorithms|authorizedkeysfile) '
 5
 6# Debian / Ubuntu
 7sudo systemctl reload ssh
 8
 9# Fedora / RHEL: use this instead
10# sudo systemctl reload sshd

Replace host and addr with the client's hostname and IP when checking Match rules. Reload only after sshd -t succeeds.

Test the login

From the client, force this signature algorithm and public key authentication for the test:

1ssh -vvv -S none \
2  -o PreferredAuthentications=publickey \
3  -o PubkeyAcceptedAlgorithms=ssh-mldsa44-ed25519 \
4  pq-server

Check the debug output for signing using ssh-mldsa44-ed25519 and successful publickey authentication. ssh -Q reports supported algorithms; ssh -G and sshd -T report effective configuration.

Optional: use a composite server host key

Host keys authenticate the server. To use this algorithm for that step too, generate a separate key on the server:

1sudo ssh-keygen -t mldsa44-ed25519 \
2  -f /etc/ssh/ssh_host_mldsa44_ed25519_key -N ''
3sudo ssh-keygen -lf /etc/ssh/ssh_host_mldsa44_ed25519_key.pub

Add to the server's global sshd_config:

1HostKey /etc/ssh/ssh_host_mldsa44_ed25519_key
2HostKeyAlgorithms +ssh-mldsa44-ed25519

If introducing explicit HostKey entries, also list the existing host key paths you want to keep: explicit entries replace the implicit default paths. Validate and reload as above. See HostKey.

In the client's Host pq-server block, prefer the new host key:

1    HostKeyAlgorithms ^ssh-mldsa44-ed25519

Reconnect with ssh -vvv -S none pq-server and check kex: host key algorithm: ssh-mldsa44-ed25519. Verify the new host key fingerprint against the server output before trusting it.

HostKeyAlgorithms controls server identity; PubkeyAcceptedAlgorithms controls user login signatures. Key exchange is configured separately with KexAlgorithms.