4voda
Notes from the practice

Before the next backup, check what your Mac and server agreed on

December 4, 2026

Your Mac sends a backup to a server over SSH. The transfer finishes, the file arrives, and the log says success. That answers the question you usually ask: did the backup get there? It doesn’t answer a second question that matters if the file contains records you’ll still want kept private in ten years: how did the Mac and the server agree on the key that protected the transfer?

On some macOS configurations, Apple’s SSH settings put a classical method called P-256 first. SSH picks the first method on the client’s list that the server also offers. Both machines can support hybrid post-quantum key exchange and still use P-256. That’s a preference setting, not a broken encryption algorithm. Check a real connection before you change anything.

Why check now?

Someone who records encrypted traffic today can keep it. If a future quantum computer becomes powerful enough to defeat classical key exchange, that recording could become readable. Nobody needs to predict when that computer will arrive to see the business risk: a customer’s date of birth will still be their date of birth. Changing a setting next year won’t protect a transfer someone recorded this morning.

Hybrid key exchange combines a classical method with a post-quantum one so the session secret doesn’t depend on either component alone. NIST recommends starting the transition. For a Mac that moves sensitive files over SSH, checking one important connection is a useful place to start. It’s not a reason to assume yesterday’s backup was compromised.

Ask the connection, not the version number

On the Mac that makes the connection, replace yourserver with a server or SSH alias you normally use and are authorized to access. For a server where you have shell access, run:

ssh -S none -v yourserver true 2>&1 | grep 'kex: algorithm:'

-S none makes a fresh connection instead of borrowing an existing one. The remote command true does nothing and exits. Read the algorithm name after the colon:

If there’s no matching line, don’t count it as a pass. Rerun without the grep filter and check the diagnostic. And test the client that actually moves your data: a Terminal session doesn’t verify a backup app that bundles its own SSH client.

Change the preference, then check again

First, run ssh -V and ssh -Q kex on the Mac. The second command lists what that client understands, not what it used. OpenSSH added ML-KEM in 9.9; upstream 9.6 doesn’t recognize the name. An unrecognized algorithm in your config can stop connections before they start. Don’t paste the line below unless both exact names appear in your list.

For a personal Mac with no special SSH policy, back up ~/.ssh/config if it exists. To prefer hybrid across hosts, put this line at the top of that file, before any Host or Include lines:

KexAlgorithms ^mlkem768x25519-sha256,[email protected]

The ^ matters. It moves those methods to the front of OpenSSH’s default list. Without it, the two names replace the list. With it, an older server can still connect using a fallback. This prefers hybrid; it does not require it. If you have host-specific exceptions or a company-managed Mac, ask your administrator before adding a global line: OpenSSH generally uses the first value it reads, so this can override a deliberate restriction.

Run the fresh-connection check again against the same server. If it still reports classical, ask the server owner which hybrid methods are enabled. If your edit causes a configuration error, remove the line or restore your backup. Leave your Ed25519 login key alone: it proves who you are, not how the session secret was established.

The useful evidence isn’t the line you put in a file. It’s the algorithm your next connection actually uses.

Start with the transfer whose contents need to stay private the longest. If you’d like help checking the process that moves those files, tell us what you’re running.

← All notes