ssh -v output before and after: ecdh-sha2-nistp256 versus mlkem768x25519-sha256

OpenSSH has offered hybrid post-quantum key exchange by default for years, but a server supporting it does not mean clients use it. macOS 26 is the reminder: an Apple configuration file makes its SSH client prefer ecdh-sha2-nistp256, as appleismo.com reported (in Spanish). Here is the server-side review worth doing now.

1. What does your sshd offer?

ssh -V
sudo sshd -T | grep ^kexalgorithms

sntrup761x25519-sha512 arrived in OpenSSH 9.0 and mlkem768x25519-sha256 in 9.9; the latter has been the default since 10.0. If either sits at the front of the list, you are fine. If neither appears, you are on an old OpenSSH or a hardening guide left a KexAlgorithms line that drops them. Check /etc/ssh/sshd_config and everything in /etc/ssh/sshd_config.d/; sshd keeps the first value it reads.

2. What is really being negotiated?

ssh -v user@server true 2>&1 | grep "kex: algorithm"Code language: JavaScript (javascript)
ssh -v output before and after: ecdh-sha2-nistp256 versus mlkem768x25519-sha256

To see it for every connection, set LogLevel DEBUG1 for a while in a sshd_config.d file, reload and grep journalctl -u ssh (sshd on RHEL and derivatives) for kex: algorithm. Switch back to INFO afterwards: debug logging is noisy and can capture sensitive data.

3. Why macOS 26 clients fall back

As Sudolabs documented, macOS 26 ships /etc/ssh/crypto.conf with KexAlgorithms ^ecdh-sha2-nistp256. The caret moves that algorithm to the front, and SSH picks the first client algorithm the server accepts. We reproduced it against GitHub: forcing that order yields ecdh-sha2-nistp256, the default yields mlkem768x25519-sha256. On a Mac running macOS 27.2.1 with OpenSSH 10.5 the file is gone. The client fix is one line at the very top of ~/.ssh/config, above any Host or Include:

KexAlgorithms ^mlkem768x25519-sha256,sntrup761x25519-sha512

Unlike a fixed list, the caret form keeps every other algorithm as a fallback, so old hosts that only speak ECDH still work.

4. Optional: require it server-side

# /etc/ssh/sshd_config.d/10-kex.conf
KexAlgorithms mlkem768x25519-sha256,[email protected],curve25519-sha256

sudo sshd -t && sudo systemctl reload sshCode language: PHP (php)

Keep curve25519-sha256 until your logs show nobody needs it, and keep a session open while you test from another terminal.

FAQ

Which OpenSSH versions support post-quantum key exchange?

sntrup761x25519-sha512 since 9.0 and mlkem768x25519-sha256 since 9.9; the latter is the default since 10.0.

How do I see the negotiated algorithm?

Run ssh -v server true 2>&1 | grep “kex: algorithm” on the client, or enable LogLevel DEBUG1 on the server for a while.

Why don’t macOS 26 Macs use it?

Because /etc/ssh/crypto.conf moves ecdh-sha2-nistp256 to the front of the client list, and SSH picks the first algorithm the server accepts.

Sources: appleismo.com, Sudolabs and OpenSSH.

Scroll to Top