December 3, 2026ยท22 min read

PQ Guide: OpenSSH and nginx

EN | DE

This guide answers one question, asked in a public thread: “what if anything do I personally need to do to my ssh and nginx config”. It covers OpenSSH, client and server, and nginx. For each part it shows how to find out what you run, how to tell whether anything needs changing, how to change it without locking yourself out or stopping the service, and how to confirm the result from the command line.

Key exchange protects the session itself: a session recorded today under a classical key exchange can be decrypted later by whoever breaks that exchange, and no change made to the server afterwards protects it. Keys and signatures can still be replaced before such a break, as our post on trust now, exploit later sets out.

The guide therefore takes key exchange first, in SSH and then in nginx, and the new SSH key type second. The examples use server.example for the server and admin for the account. Every command shown was run on test containers built from the releases in the table below, and the output shown is what they printed. Red Hat Enterprise Linux 9.9 and 10.3 were tested through Red Hat’s UBI 9 and UBI 10 container images, with OpenSSH and nginx installed from Red Hat’s UBI repositories, and gave the same results as AlmaLinux 9.9 and 10.3.

What to do, by case

What the distributions ship

The versions are those installed from each distribution’s package archive on 3 December 2026. The two right-hand columns give what a server does with no configuration of its own.

ReleaseOpenSSHsshd offers post-quantum key exchangeOpenSSL used by nginxnginx offers X25519MLKEM768
Debian 129.2yes: sntrup761x25519-sha512, under both its names3.0no
Debian 1310.0yes: mlkem768x25519-sha256 and sntrup761x25519-sha5123.5yes
Ubuntu 22.04 LTS8.9yes: sntrup761x25519-sha512@openssh.com, listed after the classical methods3.0no
Ubuntu 24.04 LTS9.6yes: sntrup761x25519-sha512@openssh.com3.0no
Ubuntu 26.04 LTS10.2yes: mlkem768x25519-sha256 and sntrup761x25519-sha5123.5yes
RHEL 9.9 and AlmaLinux 9.99.9no, under the DEFAULT crypto policy3.5no, under the DEFAULT crypto policy
RHEL 10.3 and AlmaLinux 10.39.9yes: mlkem768x25519-sha256 and two other ML-KEM methods, no sntrup3.5yes
Arch Linux10.6yes: mlkem768x25519-sha256 and sntrup761x25519-sha5124.1yes

sntrup761x25519-sha512 has two names. OpenSSH used sntrup761x25519-sha512@openssh.com from 9.0 and added the shorter name in 9.9. OpenSSH 8.9 on Ubuntu 22.04 and 9.6 on Ubuntu 24.04 know only the long name; Debian’s 9.2 package knows both. Rocky Linux 9 and 10 carry the same OpenSSH and OpenSSL versions as AlmaLinux 9 and 10 in their archives, but were not tested.

SSH key exchange: what your client and server negotiate

The client sends its key exchange methods in order of preference, and the server picks the first one on the client’s list that it also supports. Both ends therefore matter. On the client, ssh -V prints the version and ssh -G prints the list it will send to a given host. This client is Arch Linux’s OpenSSH 10.6:

ssh -V
OpenSSH_10.6p2, OpenSSL 4.1.1 1 Dec 2026
ssh -G server.example | grep -i '^kexalgorithms'
kexalgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

What a connection actually uses appears in the client’s debug output:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: curve25519-sha256

mlkem768x25519-sha256 and sntrup761x25519-sha512, under either name, are post-quantum hybrids. curve25519-sha256 and every method beginning with ecdh-sha2 or diffie-hellman is classical. The connection above is classical, although the client puts both hybrids first. From version 10.1 the client says so on every such connection:

ssh admin@server.example exit
** 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.html

On the server, here Debian 13, sshd -T prints the configuration sshd actually uses, after every included file has been read:

sudo sshd -V
OpenSSH_10.0p2 Debian-7+deb13u4, OpenSSL 3.5.9 29 Sep 2026
sudo sshd -T | grep -i '^kexalgorithms'
kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512

Debian 13 offers mlkem768x25519-sha256 and sntrup761x25519-sha512 by default, as the table shows. A list without either has had them removed, here by a configuration line. On RHEL 9 and AlmaLinux 9 the crypto policy removes them, as described below.

SSH key exchange: removing a line that pins classical methods

A KexAlgorithms line replaces the whole default list, whatever version runs. Such lines often come from hardening guides written before the post-quantum methods existed. This command finds them in the main file and in every file under /etc/ssh:

sudo grep -rni '^ *kexalgorithms' /etc/ssh/
/etc/ssh/sshd_config.d/hardening.conf:1:KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512

Delete the line. sshd then uses its default list, which on every release in the table except RHEL 9 and AlmaLinux 9 contains a post-quantum method. The same command then prints nothing.

If you have to keep a restricted list, it must contain mlkem768x25519-sha256 on OpenSSH 9.9 and later, and sntrup761x25519-sha512 under every name your version knows, because clients older than 9.9 know only the name ending in @openssh.com. It must not contain a name your version does not know. ssh -Q kex lists the names a version knows; on Debian 12:

ssh -Q kex | grep -E 'sntrup|mlkem'
sntrup761x25519-sha512
sntrup761x25519-sha512@openssh.com

A list that names mlkem768x25519-sha256 on that version is rejected by sshd -t, which checks the configuration without changing anything:

sudo sshd -V
OpenSSH_9.2, OpenSSL 3.0.22 25 Aug 2026
sudo sshd -t
Unsupported KEX algorithm "mlkem768x25519-sha256"
/etc/ssh/sshd_config.d/pq.conf line 1: Bad SSH2 KexAlgorithms 'mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256'.

sshd started with such a configuration exits with the same message, so a restart or a reboot with such a line in place leaves the server without SSH. The test therefore comes before every reload. The order that keeps you connected:

  1. Keep your current SSH session open until the end.
  2. Check the configuration. sudo sshd -t prints nothing when it is valid.
  3. Tell the running sshd to read its configuration again. Sessions already open stay open.
  4. From a second terminal, open a new session and check its key exchange before closing the first.
sudo sshd -t
sudo kill -HUP "$(cat /run/sshd.pid)"

The hangup signal makes sshd read its configuration again. The service manager’s reload does the same: systemctl reload ssh on Debian and Ubuntu, whose unit runs sshd -t and then sends this signal, and systemctl reload sshd on RHEL and AlmaLinux, whose unit sends the signal, and on Arch Linux. In our test a session opened before the signal stayed open, and the new session reported a hybrid:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: mlkem768x25519-sha256

RHEL 9.9 and AlmaLinux 9.9 have no such line. Their OpenSSH 9.9 knows mlkem768x25519-sha256 and both sntrup names, but the DEFAULT crypto policy leaves every post-quantum method out of the list sshd reads. On AlmaLinux 9.9, with the same output on RHEL 9.9:

update-crypto-policies --show
DEFAULT
sudo sshd -T | grep -i '^kexalgorithms'
kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

Red Hat’s page on post-quantum cryptography in RHEL says that “RHEL 9.7+ supports opt-in configuration using the system-wide cryptographic policy command DEFAULT:PQ” and does not call this a Technology Preview. A Red Hat blog post of 3 November 2026 says that RHEL 9 “treated post-quantum cryptography (PQC) as an opt-in Technology Preview with the DEFAULT:PQ subpolicy”. Setting the module:

sudo update-crypto-policies --set DEFAULT:PQ
Setting system policy to DEFAULT:PQ
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.
sudo sshd -T | grep -i '^kexalgorithms'
kexalgorithms mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

The same steps follow, sudo sshd -t and the hangup signal, and a new session from the OpenSSH 10.6 client then reported debug1: kex: algorithm: mlkem768x25519-sha256 on both. The policy adds mlkem768x25519-sha256 and no sntrup method, and RHEL 10 and AlmaLinux 10 likewise offer ML-KEM methods and no sntrup by default. Clients older than 9.9, which have no ML-KEM, therefore still connect classically to all four: the OpenSSH 9.6 client of Ubuntu 24.04 negotiated curve25519-sha256 with each. The policy applies to the whole system and also changes what nginx offers, as described below.

On RHEL 9 and AlmaLinux 9 a custom subpolicy adds sntrup for those clients. The crypto-policies package that RHEL 9.9 and AlmaLinux 9.9 ship accepts the value SNTRUP for key exchange, although the crypto-policies(7) manual they ship does not list it. A custom subpolicy is a file in /etc/crypto-policies/policies/modules/; its name without .pmod is added to the policy in update-crypto-policies --set. On AlmaLinux 9.9, with the same result on RHEL 9.9:

echo 'key_exchange = +SNTRUP' | sudo tee /etc/crypto-policies/policies/modules/SNTRUP.pmod
key_exchange = +SNTRUP
sudo update-crypto-policies --set DEFAULT:PQ:SNTRUP
Setting system policy to DEFAULT:PQ:SNTRUP
Note: System-wide crypto policies are applied on application start-up.
It is recommended to restart the system for the change of policies
to fully take place.
sudo sshd -T | grep -i '^kexalgorithms'
kexalgorithms sntrup761x25519-sha512@openssh.com,mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
sudo sshd -t
sudo kill -HUP "$(cat /run/sshd.pid)"

sshd now lists sntrup761x25519-sha512@openssh.com first, but the client’s order still decides. The Ubuntu 24.04 client negotiates the hybrid:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com

The OpenSSH 10.6 client keeps ML-KEM:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: mlkem768x25519-sha256

In Fedora bug 2335948, Red Hat’s crypto team wrote that sntrup has never been enabled in Fedora’s DEFAULT policy and that not enabling it is a deliberate decision, because it is not NIST-approved. RHEL 10 and AlmaLinux 10 reject the value: their crypto-policies has no setting for sntrup, and the same subpolicy fails. On RHEL 10.3:

cat /etc/crypto-policies/policies/modules/SNTRUP.pmod
key_exchange = +SNTRUP
sudo update-crypto-policies --set DEFAULT:SNTRUP
AlgorithmEmptyMatchError: Bad value of policy property `key_exchange`: `SNTRUP`
Errors found in policy, first one:  
Bad value of policy property `key_exchange`: `SNTRUP`

On RHEL 10 and AlmaLinux 10 the route for those clients goes past the crypto policy, in the SSH server’s own configuration. The update-crypto-policies(8) manual of RHEL 9.9 and 10.3 says: “To override some configuration option in server, use a drop-in directory /etc/ssh/sshd_config.d/ to create a file lexicographically preceding 05-redhat.conf which is currently including crypto policies configuration file.” No file of that name exists on the systems we tested. Their /etc/ssh/sshd_config includes /etc/ssh/sshd_config.d/*.conf, which sshd reads in lexical order, and the file in that directory that includes the policy is 40-redhat-crypto-policies.conf on RHEL 10.3 and AlmaLinux 10.3 and 50-redhat.conf on RHEL 9.9 and AlmaLinux 9.9. Its first lines say: “To override some configuration option, write it before this block or include it before this file.” sshd uses the first value it reads for each option, so a KexAlgorithms line in a file read earlier replaces the policy’s list. Because the files are read in name order, the new file’s number has to be lower than the policy file’s, so that it comes first by its number and not by the letters after it; 01-kex.conf does that on all four systems. sshd -T shows whether the file took effect, because it prints the list sshd actually uses. The list below is the policy’s own list with both sntrup names added after the ML-KEM methods. Keep your current session open, as in the steps above. On RHEL 10.3, with the same result on AlmaLinux 10.3:

sudo ls /etc/ssh/sshd_config.d/
40-redhat-crypto-policies.conf	50-redhat.conf
echo 'KexAlgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512' | sudo tee /etc/ssh/sshd_config.d/01-kex.conf
KexAlgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
sudo ls /etc/ssh/sshd_config.d/
01-kex.conf  40-redhat-crypto-policies.conf  50-redhat.conf
sudo sshd -t
sudo kill -HUP "$(cat /run/sshd.pid)"
sudo sshd -T | grep -i '^kexalgorithms'
kexalgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

The Ubuntu 24.04 client now negotiates a hybrid:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com

The OpenSSH 10.6 client keeps ML-KEM:

ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: mlkem768x25519-sha256

The cost: sshd’s key exchange list no longer follows the system policy. A later update-crypto-policies --set, or an update that changes the DEFAULT policy, does not change which key exchange methods sshd offers while the file is in place. The file sets only the key exchange list. On RHEL 9.9 and AlmaLinux 9.9 the same kind of file, listing only the methods OpenSSH 9.9 knows there (mlkem768x25519-sha256 and both sntrup names, without the two other ML-KEM methods), gave the same two results in our test; it is the alternative to the SNTRUP subpolicy, which keeps the list under the system policy. An Ubuntu update that adds mlkem768x25519-sha256 and the short sntrup name to the OpenSSH of Ubuntu 24.04 is in progress in Launchpad bug 2120496.

On the client, a KexAlgorithms line in ~/.ssh/config, /etc/ssh/ssh_config or /etc/ssh/ssh_config.d/ pins the list in the same way, and ssh -G shows its effect. A change there applies from the next connection. A client older than 9.0 is the other case: Ubuntu 22.04’s OpenSSH 8.9 knows sntrup761x25519-sha512@openssh.com but puts it after the classical methods, so it connects classically even to a server that offers it, here Debian 13 with its default list:

ssh -V
OpenSSH_8.9p1 Ubuntu-3ubuntu0.18, OpenSSL 3.0.2 15 Mar 2022
ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: curve25519-sha256

Two lines in the client’s ~/.ssh/config move it to the head of the list. The ^ places the named method first and keeps the rest of the default list after it, so servers without the method still connect:

Host *
    KexAlgorithms ^sntrup761x25519-sha512@openssh.com
ssh -v admin@server.example exit 2>&1 | grep 'kex: algorithm'
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com

nginx key exchange: the OpenSSL nginx runs with

nginx does no key exchange of its own. It uses the OpenSSL library it is linked against, as HAProxy does. On Debian 13, nginx -V names that library:

nginx -V 2>&1 | grep 'built with'
built with OpenSSL 3.5.10 1 Dec 2026 (running with OpenSSL 3.5.9 29 Sep 2026)

The version after “running with” is the library loaded now, and it is the one that counts; without that part, the two are the same. openssl version reports the command-line tool, which can be a different build, so ask nginx. OpenSSL 3.5 and later include X25519MLKEM768, the hybrid of ML-KEM-768 and X25519, in their default list of key exchange groups. Older versions have no ML-KEM at all.

Debian 12, Ubuntu 22.04 and Ubuntu 24.04 stay on OpenSSL 3.0. Debian’s rules for updates to a stable release ask for minimal fixes to bugs of severity important or higher; Debian 12 receives new OpenSSL 3.0 releases, and OpenSSL 3.5 came with Debian 13. Every Ubuntu archive pocket that carries openssl for 22.04 and 24.04 holds OpenSSL 3.0, versions 3.0.2 and 3.0.13, and Ubuntu’s release notes for 26.04 list the post-quantum algorithms in OpenSSL among the changes since 24.04, added in 25.10. The ways forward are those in our HAProxy guide: upgrade to a release with OpenSSL 3.5, such as Debian 13 or Ubuntu 26.04; run nginx from a container image or a build of your own linked against OpenSSL 3.5, and keep it updated; or add the Open Quantum Safe provider to OpenSSL 3.0.

nginx key exchange: removing an ssl_ecdh_curve line

The directive ssl_ecdh_curve sets the groups nginx accepts. Without it nginx uses auto, which is OpenSSL’s own default list. nginx -T prints the complete configuration with a header for each included file, so this finds the line and the file it is in:

sudo nginx -T 2>/dev/null | grep -E '^# configuration file|ssl_ecdh_curve' | grep -B1 ssl_ecdh_curve
# configuration file /etc/nginx/conf.d/server-example.conf:
    ssl_ecdh_curve X25519:prime256v1:secp384r1;

A line that lists only classical groups, as this one does, switches the hybrid off. To see what a server accepts, offer it the hybrid alone from a machine with OpenSSL 3.5 or later, here Ubuntu 26.04:

openssl version
OpenSSL 3.5.5 27 Jan 2026 (Library: OpenSSL 3.5.5 27 Jan 2026)
openssl s_client -connect server.example:443 -groups X25519MLKEM768 </dev/null 2>/dev/null | grep 'Negotiated TLS1.3 group'
Negotiated TLS1.3 group: <NULL>

<NULL> means the server refused it. Delete the line, then test the configuration and reload. After the deletion the search prints nothing:

sudo nginx -T 2>/dev/null | grep -E '^# configuration file|ssl_ecdh_curve' | grep -B1 ssl_ecdh_curve
sudo nginx -t && sudo nginx -s reload
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
2026/12/03 12:42:58 [notice] 1183#1183: signal process started

A reload starts new worker processes with the new configuration while the old ones finish serving their connections, so the service does not stop. systemctl reload nginx does the same on every release in the table: its unit runs nginx -s reload. The same check now succeeds, and a client offering only X25519 still connects. For a classical group, OpenSSL prints Peer Temp Key in place of the negotiated group:

openssl s_client -connect server.example:443 -groups X25519MLKEM768 </dev/null 2>/dev/null | grep 'Negotiated TLS1.3 group'
Negotiated TLS1.3 group: X25519MLKEM768
openssl s_client -connect server.example:443 -groups X25519 </dev/null 2>/dev/null | grep -E 'Negotiated TLS1.3 group|Peer Temp Key'
Peer Temp Key: X25519, 253 bits

If you keep a line instead, X25519MLKEM768 may appear in it only when nginx -V reports OpenSSL 3.5 or later. On such a version, put it first and keep X25519 and the classical curves after it; the nginx documentation asks for the curves of an ECDSA certificate to be in the list:

ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;

On Debian 13 this line gave the same two results as no line at all. A line naming only X25519MLKEM768 refuses every client that lacks the hybrid:

openssl s_client -connect server.example:443 -groups X25519 </dev/null 2>&1 | grep -E 'alert|Negotiated'
40A71E5B52760000:error:0A000410:SSL routines:ssl3_read_bytes:ssl/tls alert handshake failure:../ssl/record/rec_layer_s3.c:918:SSL alert number 40
Negotiated TLS1.3 group: <NULL>

On OpenSSL older than 3.5, the name X25519MLKEM768 is a configuration error. On Debian 12:

nginx -V 2>&1 | grep 'built with'
built with OpenSSL 3.0.22 25 Aug 2026
sudo nginx -t && sudo nginx -s reload
2026/12/03 12:43:02 [emerg] 916#916: SSL_CTX_set1_curves_list("X25519MLKEM768:X25519:prime256v1:secp384r1") failed (SSL: error:0A080106:SSL routines::passed invalid argument:group 'X25519MLKEM768' cannot be set)
nginx: configuration file /etc/nginx/nginx.conf test failed

The test stops the reload, and the running nginx kept serving with its old configuration. With nginx stopped and started again, as after a restart or a reboot, it exited with the same message and left port 443 closed. Prefixing the name with ?, which tells OpenSSL 3.5 to skip a group it does not know, does not help on 3.0, which does not know the prefix either; the same test then fails on group '?X25519MLKEM768' cannot be set.

RHEL 9.9 and AlmaLinux 9.9 ship nginx 1.20.1 built with OpenSSL 3.5.9, but under the DEFAULT crypto policy nginx with no ssl_ecdh_curve line answered the hybrid-only check with <NULL> on both. After update-crypto-policies --set DEFAULT:PQ from the SSH section, nginx on both still answered <NULL> after a reload and answered X25519MLKEM768 after it was stopped and started again. On a running system that is systemctl restart nginx, which closes the connections that are open, so schedule it for a quiet moment.

Checking nginx from outside

The checks above reach the server from wherever you run them. Visitors reach it through whatever sits in front of it, such as a load balancer, a CDN or a firewall, and the key exchange they get is the one that device negotiates. The free probe at pqprobe.eu connects from the internet: enter the host with its port, such as server.example:443, and the result shows the key exchange the server negotiated and whether it is a post-quantum hybrid. It reaches public addresses only. Some firewalls and load balancers fail the larger first handshake message a post-quantum client sends; our post on network gear describes how to find them.

The SSH hybrid key type ssh-mldsa44-ed25519: host keys

OpenSSH 10.6 enabled ssh-mldsa44-ed25519, a key type that combines the post-quantum signature ML-DSA-44 with Ed25519, for host keys and user keys. A key signs; it proves who is at the other end and does not protect a recorded session, so it can follow the key exchange. It works only when both ends run 10.6 or later. Of the releases in the table, only Arch Linux ships 10.6, so on the others this section and the next do not apply yet. Our post on developer workstations covers the versions before 10.6, including keys made with the experimental support in 10.4, which have to be made again.

On a 10.6 server, check whether the host key exists:

ssh -V
OpenSSH_10.6p2, OpenSSL 4.1.1 1 Dec 2026
ls /etc/ssh/ssh_host_*_key.pub
/etc/ssh/ssh_host_ecdsa_key.pub    /etc/ssh/ssh_host_rsa_key.pub
/etc/ssh/ssh_host_ed25519_key.pub

ssh-keygen -A creates the host keys that are missing and leaves the existing ones alone:

sudo ssh-keygen -A
ssh-keygen: generating new host keys: MLDSA44-ED25519

sshd loads the new key by default. A server whose sshd_config names its own HostKey lines loads only those, and then needs a line for /etc/ssh/ssh_host_mldsa44_ed25519_key. sshd -T shows the keys sshd will use:

sudo sshd -T | grep -i '^hostkey '
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_mldsa44_ed25519_key

Test and reload as for the key exchange:

sudo sshd -t && sudo kill -HUP "$(cat /run/sshd.pid)"

A 10.6 client that already knows the server learns the new key on its next connection and adds it to known_hosts. The connection prints nothing about it, and ssh-keygen -F shows the keys now on record:

ssh admin@server.example exit
ssh-keygen -F server.example -l | grep -v '^#'
server.example ED25519 SHA256:+p+i4K4iM93VvgZeBobRHbtnTeJecXWK/vh2AxCFB2w
server.example RSA SHA256:nGYoZJk/hevE57TKHspI+tE8iZmN3vtNzI/pHLcXlYs
server.example ECDSA SHA256:Zet8isqaCMaHcs9Dmw8CJQHebo7V3OGNY3ltoZA3qUc
server.example MLDSA44-ED25519 SHA256:ZCxxc/kYfHg44ljI+5P7UmT1OrDTMtOcRZyvIMIJBTQ

On the server, ssh-keygen -l -f prints the same fingerprint for comparison:

ssh-keygen -l -f /etc/ssh/ssh_host_mldsa44_ed25519_key.pub
512 SHA256:ZCxxc/kYfHg44ljI+5P7UmT1OrDTMtOcRZyvIMIJBTQ root@arch (MLDSA44-ED25519)

The client still verifies the server with Ed25519, because ssh-mldsa44-ed25519 comes last in its default order of host key types:

ssh -v admin@server.example exit 2>&1 | grep 'Server host key'
debug1: Server host key: ssh-ed25519 SHA256:+p+i4K4iM93VvgZeBobRHbtnTeJecXWK/vh2AxCFB2w

Two lines in the client’s ~/.ssh/config put it first for this server:

Host server.example
    HostKeyAlgorithms ^ssh-mldsa44-ed25519
ssh -v admin@server.example exit 2>&1 | grep 'Server host key'
debug1: Server host key: ssh-mldsa44-ed25519 SHA256:ZCxxc/kYfHg44ljI+5P7UmT1OrDTMtOcRZyvIMIJBTQ

Name each server, and add it only after ssh-keygen -F lists its new key. Under Host * the preference applies to every server, including one that gains the new key later while your client still has only its Ed25519 key on record. The client then asks that server for the new type and refuses the key it receives, before it can learn it. In our test the client had the preference under Host * and the server’s Ed25519 key on record, and the server then generated its new key and reloaded:

ssh admin@server.example exit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the MLDSA44-ED25519 key sent by the remote host is
SHA256:ZCxxc/kYfHg44ljI+5P7UmT1OrDTMtOcRZyvIMIJBTQ.
Please contact your system administrator.
Add correct host key in /home/admin/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /home/admin/.ssh/known_hosts:1
Host key for server.example has changed and you have requested strict checking.
Host key verification failed.

The server is the same; the client asked for a key type it has no record of. Removing the preference restores the connection, and one connection without it lets the client learn the key, which is how the ssh-keygen -F output above came about. A server older than 10.6 has no key of the new type, and a client with the preference uses Ed25519 with it as before.

The SSH hybrid key type ssh-mldsa44-ed25519: your own key

Before making the key, check that the server you want to use it with accepts the type. After the key exchange a server sends the list of signature algorithms it accepts for user keys, and the client prints it in its debug output as server-sig-algs. The list arrives before authentication, so the check works without a login. The line can appear more than once, with the same list each time. Against the 10.6 server:

ssh -v admin@server.example exit 2>&1 | grep server-sig-algs
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-mldsa44-ed25519,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-mldsa44-ed25519,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>

The list contains ssh-mldsa44-ed25519. When server.example ran OpenSSH 10.0 on Debian 13, it did not:

ssh -v admin@server.example exit 2>&1 | grep server-sig-algs
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>

A server whose list lacks the type is not offering to accept a key of that type. The server’s host key algorithms, which ssh -vv prints earlier in the same debug output, are the key types the server identifies itself with; that is a different list and does not answer this question.

A user key of the new type is made like any other and lives beside the existing one:

ssh-keygen -t mldsa44-ed25519

This writes ~/.ssh/id_mldsa44_ed25519 and its .pub file. ssh-copy-id logs in with the key you use today and appends the new public key to the server’s authorized_keys, leaving the existing keys in place:

ssh-copy-id -i ~/.ssh/id_mldsa44_ed25519.pub admin@server.example
/usr/sbin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/admin/.ssh/id_mldsa44_ed25519.pub"
/usr/sbin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/sbin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -i /home/admin/.ssh/id_mldsa44_ed25519 'admin@server.example'"
and check to make sure that only the key(s) you wanted were added.

Test the new key on its own:

ssh -v -i ~/.ssh/id_mldsa44_ed25519 admin@server.example exit 2>&1 | grep 'Server accepts key'
debug1: Server accepts key: /home/admin/.ssh/id_mldsa44_ed25519 MLDSA44-ED25519 SHA256:BUJwn0JiAJ9r5YCXUrHJuo+/inkpP4pLdJLFHt3AqWM explicit

Without -i the client offers ~/.ssh/id_ed25519 first, and the server accepts that:

ssh -v admin@server.example exit 2>&1 | grep 'Server accepts key'
debug1: Server accepts key: /home/admin/.ssh/id_ed25519 ED25519 SHA256:9s4Gyl5VEavhtQ2bnyyxU++FCiZ1tvuO89TnvMCvUtw

To offer the new key first and keep the old one as a fallback, name both under the same server entry, in this order:

Host server.example
    HostKeyAlgorithms ^ssh-mldsa44-ed25519
    IdentityFile ~/.ssh/id_mldsa44_ed25519
    IdentityFile ~/.ssh/id_ed25519

Against the 10.6 server both the host key and the user key are now the hybrid:

ssh -v admin@server.example exit 2>&1 | grep -E 'Server host key|Server accepts key'
debug1: Server host key: ssh-mldsa44-ed25519 SHA256:ZCxxc/kYfHg44ljI+5P7UmT1OrDTMtOcRZyvIMIJBTQ
debug1: Server accepts key: /home/admin/.ssh/id_mldsa44_ed25519 MLDSA44-ED25519 SHA256:BUJwn0JiAJ9r5YCXUrHJuo+/inkpP4pLdJLFHt3AqWM explicit

With the same entry, when server.example ran OpenSSH 10.0 on Debian 13, the client used Ed25519 for both and logged in:

ssh -v admin@server.example exit 2>&1 | grep -E 'Server host key|Server accepts key'
debug1: Server host key: ssh-ed25519 SHA256:0qROmFMZuFu8vtSuGCqZtLD/QG8UZzez4BlOk9OeQg8
debug1: Server accepts key: /home/admin/.ssh/id_ed25519 ED25519 SHA256:9s4Gyl5VEavhtQ2bnyyxU++FCiZ1tvuO89TnvMCvUtw explicit

Keep the old public key in authorized_keys as long as any client that logs in to the server runs a version older than 10.6.


Sources: