ssh -vvv. Data as of October 2026 (lab run of 5 October 2026). Reading: 42 min, plus 33 in closed details.SSH is one encrypted TCP connection in which the server first proves who it is with its host key, you then prove who you are with a key or certificate, and any number of independent channels (a shell, a file copy, a tunnel) then share that pipe. Every cluster pattern on this page is a way of nesting or reusing those channels: ProxyJump runs a second, end-to-end SSH session inside a channel of the first, ControlMaster lets later commands open channels on a pipe that is already authenticated, and port forwarding carries TCP connections as channels.
Fig. 1 builds one login, ssh bastion true, from the bottom up, with the sizes the lab recorded (default key exchange, laptop OpenSSH 10.3p1 to bastion OpenSSH 10.5p1). The lab: a laptop, a bastion published on 127.0.0.1:30922, and two compute nodes on an internal network the laptop cannot route to (gpu-node-01 runs a token-protected stand-in for Jupyter; gpu-node-02 plays an old login node).
SSH-2.0-OpenSSH_10.3, SSH-2.0-OpenSSH_10.5) and a KEXINIT listing what it supports (1672 and 1040 bytes). Anyone on the path can read all of it (section 1).known_hosts (sections 3 and 4).authorized_keys (section 2).rsync and a tunnel to a notebook are independent channels on the one connection (illustrative lanes; sections 7 and 8).gpu-node-01: the bastion relays ciphertext it cannot read (sections 5 and 6).TCP connections and round trips (Networking foundations); Diffie-Hellman key agreement and signatures, and how X.509 certificates work (TLS and certificates, section 1). Login nodes and Slurm jobs are on Cluster anatomy and Slurm.
1. Never click through a changed host key; use host certificates where nodes churn (3, 4). 2. ProxyJump, not agent forwarding (6). 3. Turn on ControlMaster: 850 ms to 114 ms per command (7). 4. Loopback is shared by every user of a node: serve notebooks on a private Unix socket (8). 5. Short-lived certificates beat authorized_keys at scale (4). 6. Post-quantum key exchange is already the default and costs nothing measurable (11). 7. Patch, and keep port 22 off the internet: pre-authentication bugs ignore your keys (12).
@cert-authority lines.ssh-agent: holds decrypted private keys and signs on request over a Unix socket.ssh, server sshd); the current release is 10.5, of 11 August 2026 (OpenSSH release notes). The laptop client is OpenSSH 10.3p1 (macOS); the bastion and gpu-node-01 run OpenSSH 10.5p1 (Alpine edge), gpu-node-02 runs Alpine 3.20's patched 9.7p1, configured with no post-quantum key exchange to play an old node. The lab account is called dev, a second local user alice. Every ssh call used -F with the lab's own config, so no personal key or known_hosts was touched; private keys never left the lab directory. An observer was simulated with a small relay on the laptop that decodes the SSH packets until encryption starts (no packet capture tool was used, so nothing below the TCP payload is shown). Where a delay is stated, 40 ms was added to the bastion's outward link with tc netem. Installing Jupyter adds nothing to the protocol story, so the notebook is a token-protected Python web server. Logs are verbatim except that the lab directory is written $LAB and the laptop's name laptop; -vvv logs are trimmed of per-packet lines; addresses such as 172.21.0.2 are the containers' private network. Scripts and raw outputs: src/lab/, src/raw/; rerun with src/run_all.sh.Recorded 5 October 2026, laptop OpenSSH 10.3p1 to bastion OpenSSH 10.5p1, one connection per key exchange (forced with -o KexAlgorithms=). Bars to scale by bytes on the wire; sizes are whole SSH packets (length field, padding included). Time is the median of 15 fresh logins with no added delay; most of it is the container port proxy, not cryptography.
Before SSH (1995), telnet and rlogin sent everything, passwords included, as readable text, and rcp and ftp copied files the same way. SSH replaced all of them with one protocol that encrypts and authenticates. Version 2, the only one in use, is four RFCs from January 2006: the architecture (RFC 4251), user authentication (RFC 4252), the transport layer (RFC 4253) and the connection protocol (RFC 4254), plus many later extensions.
The three layers on one TCP connection are the stack of Fig. 1 (lose the connection and every channel goes with it):
SSH-2.0-OpenSSH_10.3 and SSH-2.0-OpenSSH_10.5: anyone on the path sees your software version). Both then send KEXINIT, a list of what they support in ten categories (key exchange, host key type, cipher and MAC each way, compression, languages); in each category the winner is the first entry on the client's list that the server also supports (RFC 4253 section 7.1). Then a key exchange (Diffie-Hellman style: each side sends a fresh public value, both compute the same secret, an eavesdropper cannot), in which the server also signs a hash of everything exchanged so far with its host key. That hash, H, becomes the session identifier. Both send NEWKEYS and switch on encryption.session (a shell, a command, or a subsystem such as SFTP), direct-tcpip (reach a host and port through the server: -L, -D and ProxyJump), forwarded-tcpip (the server forwards a connection back to you: -R), and channels for X11 and the agent. One login can carry a shell, an rsync and three tunnels at once, and one dead TCP connection kills all of them together.A relay between the laptop and the bastion decoded every SSH packet of ssh bastion true (log in, run nothing, leave) until encryption started; after NEWKEYS it could see only sizes. Predict before you step: how much bigger is the post-quantum default's key exchange than the classic one, and how much slower is the login?
The sizes, then the formula. Key-exchange messages: 2512 bytes for the hybrid against 240 for classic X25519; median login 61 ms against 56 ms. In the hybrid, the client's KEX_HYBRID_INIT carries an X25519 public key (32 bytes) and an ML-KEM-768 encapsulation key (1,184 bytes); the reply carries an X25519 key and a 1,088-byte ML-KEM ciphertext, plus the host key and signature (sizes from FIPS 203; layout in RFC 10042 section 2.1). Payload of the recorded init: 1 (message type) + 4 (length) + 32 + 1,184 = 1,221 bytes, exactly what the relay saw. The two secrets are combined as K = HASH(KPQ || KCL) (RFC 10042 section 2.4), so the result is safe if either half holds. The rest of the login (authentication, one channel, exit status) was 888 encrypted bytes up and 2040 down, the same for every key exchange.
ObscureKeystrokeTiming (on by default; OpenSSH 9.5 release notes).With 40 ms added between laptop and bastion, the server's banner arrived at 123 ms (TCP setup plus the first round trip, plus the container proxy), keys were in place at 176 ms, and the command finished at 480 ms: about eight round trips for one ssh host command. Through a jump host you pay that twice, the second set inside the first (section 5); section 7 removes it. Every arrow is a real packet group at its real time; labels after NEWKEYS are inferred from order, size and the client's -vvv log.
Reading ssh -vvv. -v prints the client's view of each step; -vv and -vvv add detail. The lines worth finding are in the closed block below; the one to remember: for each option the first value obtained wins, so specific Host blocks go before Host *.
-vvv lines worth finding, from the recorded log of this login| Line | Tells you |
|---|---|
Reading configuration data ..., Applying options for ... | which config file and which Host blocks matched. For each option the first value obtained wins, so specific blocks go before Host *. |
Connecting to 127.0.0.1 [127.0.0.1] port 30922. | the address actually dialled (after HostName, DNS and any proxy) |
Remote protocol version 2.0, remote software version OpenSSH_10.5 | the server's banner |
kex: algorithm: mlkem768x25519-sha256, kex: host key algorithm: ssh-ed25519 | what was negotiated (the cipher lines follow) |
Server host key: ssh-ed25519 SHA256:..., Host 'bastion' is known and matches | the host key check (section 3) |
Authentications that can continue: publickey | methods the server will accept |
Offering public key: ..., Server accepts key: ... | each key tried, in order (section 2) |
Authenticated to ... using "publickey". | login done; then channel 0: new [client-session] and the request |
ssh -vvv bastion true (trimmed of per-packet lines)rekey out after 134217728 blocks (227 blocks), and RekeyLimit sets it. Since OpenSSH 10.4 a peer that sends non-key-exchange messages during a post-authentication rekey is disconnected (10.4 release notes).Passwords sent to a server can be guessed, phished, reused and brute-forced, and they are the whole input of the internet's SSH-guessing botnets. A key pair fixes that: a private key that never leaves your machine and a public key you can hand to anyone. To log in, the client signs a message that includes the session identifier from section 1; the server checks the signature with the public key listed in ~/.ssh/authorized_keys.
ssh-connection"publickey"algorithmyour public keyserver host key (hostbound only)
Signed with your private key; the server verifies with the public key in authorized_keys. Field list from RFC 4252 section 7; OpenSSH's publickey-hostbound-v00@openssh.com also binds the server's host key into the signature (seen in the recorded log in section 1), so a malicious server cannot replay the signature elsewhere.
ssh-keygen -t ed25519 -C "dev@laptop" # Ed25519 is the default type since OpenSSH 9.5 ssh-keygen -p -a 100 -f ~/.ssh/id_ed25519 # add or change the passphrase, with more KDF rounds
rsa-sha2-512); DSA was removed entirely in OpenSSH 10.0 (9 April 2025), "completing the deprecation process that began in 2015" (10.0 release notes).-a sets the rounds. It protects a stolen file, nothing else: once the key is in an agent, anything that can talk to the agent can use it.ssh-keygen -t ed25519-sk keeps the private key inside the token and needs a touch per login; -O resident stores it on the token so you can load it on another machine, -O verify-required adds a PIN. The server must run OpenSSH 8.2 or newer.authorized_keys line can limit the key: restrict (no forwarding, no pty), from="198.51.100.0/24", command="..." (this key may only run one command: backup or CI keys). See sshd(8) AUTHORIZED_KEYS FILE FORMAT.ssh-agent holds your decrypted keys in memory and signs on request through a Unix socket named by SSH_AUTH_SOCK: you type the passphrase once, and ssh, git and rsync use the key without seeing it. Useful flags: ssh-add -t 8h (forget the key after 8 hours), ssh-add -c (confirm every use), ssh-add -l (list). Since 10.1 agent sockets live under ~/.ssh/agent/ instead of /tmp, so a sandboxed process that can read /tmp no longer reaches your keys (the forwarded socket on the bastion in section 6 is at /home/dev/.ssh/agent/s.…); scripts that hard-coded /tmp/ssh-XXXX break.
-a: the 10.3 manual gives 16; the current OpenBSD manual says 32. The agent protocol is now RFC 9987 (Standards Track, May 2026); since OpenSSH 10.3 the IANA-assigned names are used when the server offers them, which is why the recorded server advertises an agent-forward extension in its EXT_INFO.The client offers keys one at a time, and each refusal counts against the server's MaxAuthTries, 6 by default (recorded with sshd -T). An agent full of keys exhausts it before the right key is tried: recorded with seven unrelated keys in the agent and the right key named in IdentityFile, the server disconnected with "Too many authentication failures". The fix is IdentitiesOnly yes, which offers only the keys your config names. To see the order without connecting, OpenSSH 10.5 added ssh -Z host (recorded with the bastion's 10.5 client; the laptop's 10.3 lacks it); it lists the default identity names, including the new id_mldsa44_ed25519 (section 11).
IdentityFile lines add upHost * goes last. IdentityFile is the exception: "Multiple IdentityFile directives will add to the list of identities tried" (ssh_config(5)). The first certificate tests on this page all "succeeded", even the expired certificate, because the Host * block's ordinary key was also offered and accepted. If a test of one key must fail, give it a config where no other IdentityFile applies, and check ssh -G host | grep identityfile.IdentitiesOnly yesssh -Z (OpenSSH 10.5)sshd -T, OpenSSH 10.5p1)Cloud and cluster nodes are often rebuilt from an image that generates new host keys at first boot; the lab did exactly that. Recorded: first contact with a new node (answered yes, with the fingerprint read on the node itself, the comparison you are supposed to make through another channel such as the cloud console, the admin or a provisioning log); the node rebuilt (a new container, so new host keys) under accept-new and under no; the stale line removed. Highlighted lines only; full logs below.
Encryption is worthless if you are encrypting to the attacker. In the key exchange the server signs the exchange hash with its host key, and the client must decide whether that key really belongs to gpu-node-01. TLS answers with certificate authorities; plain SSH answers with trust on first use (TOFU): the first time, it shows the key's fingerprint and asks; after that it remembers the key in ~/.ssh/known_hosts and insists on the same one. The first connection is the weak moment; every later one is protected. The host key is SSH's only defence against a man in the middle (an attacker on the path who pretends to be the server).
accept-new adds unknown hosts silently but still refuses a changed key: exit 255, "Host key verification failed".ssh-keygen -R gpu-node-01 deletes the old entry (and keeps a backup); the next login is a first contact again.Two details from these logs. <no hostip for proxy command>: through a jump host the client never learns the node's address, so the entry is filed under the name only. And with StrictHostKeyChecking no the client logged in and ran the command: OpenSSH blocks password and keyboard-interactive login (an impostor would capture the password), and agent and port forwarding when requested, but a public-key login proceeds and you are now typing into a machine you have not verified. That is why no must never be a habit. The honest fix after a known rebuild: compare the new fingerprint out of band, then ssh-keygen -R host.
StrictHostKeyChecking | Unknown host | Known host, changed key |
|---|---|---|
ask (default) | shows the fingerprint, asks | refuses |
accept-new | adds silently | refuses (recorded) |
yes | refuses (recorded: No ED25519 host key is known for gpu-node-02 and you have requested strict checking.) | refuses |
no | adds silently | connects, with some features disabled (recorded) |
Behaviour from ssh_config(5), each cell confirmed in the lab except "ask, changed".
ssh-keygen -R without looking, and the one day it is a real man in the middle it gets the same treatment. Three ways out, best first: host certificates (section 4: nothing changes on the client when a node is rebuilt); a separate, throwaway known_hosts with accept-new scoped to the ephemeral nodes only (Host gpu-node-*, never Host *, never the bastion); or distributing the keys (a managed /etc/ssh/ssh_known_hosts, or SSHFP below).HashKnownHosts yes stores names as hashes so a stolen known_hosts does not list every machine you use (default no upstream; some distributions turn it on). Lookups still work; ssh-keygen -F host finds an entry.UpdateHostKeys: after login the server can send all its host keys (signed), so the client learns the others before a key rotation (the "hostkeys" extension in PROTOCOL).VerifyHostKeyDNS yes makes the client trust them. Only meaningful if the answer is DNSSEC-validated (see DNS), and it had a real bug: CVE-2025-26465, an on-path attacker could impersonate any server when VerifyHostKeyDNS was on, OpenSSH 6.8p1 to 9.9p1, fixed in 9.9p2 (18 February 2025, found by Qualys; release notes). Since 10.1 the release notes warn that SHA-1 SSHFP records will be ignored in a future release; publish SHA-256 ones (ssh-keygen -r host).known_hosts. On a cluster with host certificates this situation becomes rare and therefore alarming, which is the point.With plain keys, trust is a list on every machine: N users' public keys in authorized_keys on M nodes, and M host keys in every user's known_hosts. Adding a person, removing a leaver, rebuilding a node all mean editing lists everywhere. SSH certificates replace the lists with one trusted certificate authority (CA) key: the CA signs a statement "this public key belongs to dev, may log in as dev, until 01:15 tomorrow", and every node trusts anything the CA signed. Not X.509 (the web's format, on TLS and certificates): OpenSSH's own simpler format, since OpenSSH 5.4 in 2010 (PROTOCOL.certkeys), with no chains: one CA signs, and the CA key is configured directly.
Illustrative fleet of 20 users and 50 nodes: plain keys need 20 × 50 = 1,000 authorized_keys entries and 50 host keys in every user's known_hosts; certificates need one TrustedUserCAKeys line per node and one @cert-authority line per user.
ssh-keygen -s user_ca -I dev@2026-10-05 -n dev -V +8h -z 42 id_cert_only.pub # writes id_cert_only-cert.pub # on every node, once: TrustedUserCAKeys /etc/ssh/user_ca.pub (sshd_config)
-I is the key ID that appears in the server's log, -n the principals (the account names it may log in as), -V the validity window, -z a serial number for revocation. Each case below was signed and tried against gpu-node-01; the left is all the client ever says, the right is the server's log. Predict first: what does the client print for an expired certificate?
"Permission denied (publickey)" is all the client learns, deliberately, so an attacker learns nothing either. Since OpenSSH 10.1 the server logs "enough information to identify the certificate in addition to the reason" (10.1 release notes): that is the Refusing certificate ID ... Certificate invalid: expired line. Ask whoever can read /var/log/auth.log or journalctl -u sshd. On the accepted login the node's log names the certificate, its serial and the CA.
ssh-add drops a certificate from the agent five minutes after it expires (-N disables this).ssh-keygen -k -f revoked.krl -s user_ca.pub spec, pushed to nodes and named by RevokedKeys; ssh-keygen -Q -f revoked.krl cert checks a certificate against it (recorded in the "revoked" case). Since 10.3 RevokedKeys accepts several files.-O no-port-forwarding, -O force-command=..., -O source-address=198.51.100.0/24. The recorded certificate carries the default extensions (permit-pty, permit-port-forwarding and so on).Recorded: accepted with no prompt; the node rebuilt (new key, re-signed at boot, as an image or a cloud-init step would do); a certificate signed for gpu-node-99. Highlighted lines only; full logs below.
The same idea in the other direction. Provisioning signs each node's host key with a host CA (ssh-keygen -s host_ca -h -I gpu-node-01-host -n gpu-node-01 -V +52w ssh_host_ed25519_key.pub), the node presents it (HostCertificate in sshd_config), and clients carry one line instead of one per node: @cert-authority gpu-node-* ssh-ed25519 AAAAC3Nza... in known_hosts.
known_hosts holds only the bastion and one @cert-authority line; the node is accepted with no prompt.gpu-node-99: the CA line does not vouch for gpu-node-01, and no plain key is known either, so the login is refused.Who runs the CA. In practice a service signs after a single sign-on login, and the CA private key becomes the most valuable secret you have: keep it offline or in an HSM or KMS. The same short-lived-credential idea for services and agents (tokens, mTLS) is on Auth.
Signing by hand is fine for a lab; in practice: HashiCorp Vault's SSH secrets engine, Teleport (CA, short-lived certificates, session recording), Smallstep, or cloud equivalents; Netflix published BLESS, a Lambda-based CA. ssh-keygen -s can sign with a CA key held in an agent (-U; 10.2 fixed a bug in exactly that path).
ssh-keygen warns ("certificate will contain no principals"), and the node refused it (recorded). Before 10.3 a certificate with no principals matched any user when trusted through an authorized_keys line with cert-authority,principals=""; 10.3 made it match none. CAs trusted through TrustedUserCAKeys, as here, never had that behaviour (10.3 release notes).authorized_keys principals="", not via TrustedUserCAKeys. That it "broke CA tooling" could not be confirmed from any primary source and is dropped.authorized_keys.Compute nodes are not routable from your laptop; only the bastion is. Logging in to the bastion and running ssh again from there makes the second login use keys on (or forwarded to) the bastion, and every tool (rsync, git, VS Code) would have to do the same dance. ProxyJump (OpenSSH 7.3, August 2016) does it properly: your laptop asks the bastion for a raw TCP stream to gpu-node-01:22 and then runs a second, complete SSH session from the laptop to the node through that stream.
ssh -J bastion gpu-node-01 # one hop
ssh -J bastion,login gpu-node-07 # two hops, in order
# or in ~/.ssh/config, so every tool gets it:
Host gpu-node-*
ProxyJump bastion
ssh -W. The client converts ProxyJump bastion into ProxyCommand ssh -W '[gpu-node-01]:22' bastion, a "stdio forward" whose standard input and output become the TCP stream, and logs in to the bastion. Recorded: Executing proxy command: exec ssh ... -W '[gpu-node-01]:22' bastion.direct-tcpip request to gpu-node-01 port 22: it connects the stream and relays bytes. Its log shows nothing more about the node session.Authenticated to gpu-node-01 (via proxy).What the bastion sees. The node's session is encrypted end to end between laptop and node; the bastion relays ciphertext. The relay on the laptop's path, during a ProxyJump session that pulled about 27 KB of output, decoded the bastion's handshake and nothing else: the node's banner, its key exchange and everything after travelled inside the outer encryption, 5116 bytes up and 6732 down, unreadable to the observer and to the bastion alike.
What it costs. Two full logins, the second inside the first. Without added delay, ssh bastion true took 57 ms and ssh gpu-node-01 true through it 112 ms (medians of 10); with 40 ms between laptop and bastion, 429 ms against 850 ms. Section 7 removes most of that. Each hop's options come from its own Host block, so the bastion can use a hardware key and long multiplexing while nodes use a throwaway known_hosts; ProxyJump none disables an inherited jump.
-vvv and the bastion's server logProxyCommand ssh -W %h:%p bastion, and before 5.4, ProxyCommand ssh bastion nc %h %p. ProxyCommand still matters for non-SSH transports: AWS Session Manager, for example, provides one so that plain ssh, -J and rsync work over it (AWS docs).%-expansion could lead to code execution when a ProxyCommand using %r was configured (CVE record); the scenario is a crafted ssh:// or git URL. 10.3 added validation of user and host names given to -J on the command line (not in config files). OpenSSH's own advice: never build ssh command lines from untrusted input.Agent forwarding (ssh -A, ForwardAgent yes) solves the same problem the old way: the bastion's sshd creates a socket there that relays signing requests back to the agent on your laptop, so ssh gpu-node-01 typed on the bastion can authenticate as you. The cost: anyone who can open that socket while you are connected can authenticate as you, to any server that trusts your key. That is the bastion's root, or any process running as your user there. Your private key never leaves the laptop, but it does not need to. Recorded three ways: in each, while the session was open, the lab played a malicious root on the bastion (look for agent sockets, list the keys, try to log in to both nodes as dev). Predict which of the three stops root completely. With -A, root on the bastion logged in to both nodes as you; a constrained key limited it to one; ProxyJump left nothing to steal.
-A. The laptop authenticates with its key. Because of ForwardAgent yes, the bastion's sshd creates a socket for this session that relays signing requests back to the laptop's agent.ssh gpu-node-01 asks the socket to sign; the request travels back to the laptop, which signs. It worked: gpu-node-01./home/dev/.ssh/agent/ and runs ssh-add -l with it: the laptop's key is listed. Root needs no file and no passphrase.ssh dev@gpu-node-01 and ssh dev@gpu-node-02. Recorded: both logged in.ssh-add -h bastion -h "bastion>gpu-node-01": the agent may sign for the laptop-to-bastion login and for the bastion-to-gpu-node-01 hop only, identified by host keys (OpenSSH 8.9 and later).-A; the bastion hops to gpu-node-01. Each login binds the session to the server's host key (session-bind@openssh.com), so the agent knows which hop is asking. The allowed hop worked; the session's own attempt at gpu-node-02 got Permission denied (publickey).direct-tcpip channel to gpu-node-01:22. No agent channel exists.The three results, from src/raw/agent_*.txt: with plain forwarding root found /home/dev/.ssh/agent/s.…, listed the laptop's key, and logged in to both nodes as dev. With a destination-constrained key (ssh-add -h bastion -h 'bastion>gpu-node-01', OpenSSH 8.9 and later) root could still use it, but only for the hop you allowed: gpu-node-01 worked, gpu-node-02 was refused, because the agent checks each request against the host keys bound into the session (session-bind@openssh.com). With ProxyJump there was no socket to find.
Rules. Use ProxyJump. If a workflow truly needs a key on a remote machine (pushing to GitHub from a login node), prefer a separate deploy key there (section 13) over forwarding; if you must forward, forward a constrained key, add ssh-add -c so every use asks you, and never put ForwardAgent yes under Host *. On the server, AllowAgentForwarding no on a bastion is reasonable when everyone uses ProxyJump (it was enabled here to record the attack).
ssh-add -x locks the agent with a password. 10.5 fixed a bug where a locked agent refused the session-bind messages that identify forwarded use, so operations meant to be local-only (adding PKCS#11 tokens, using destination-restricted keys) could be done remotely (10.5 release notes).DisableForwarding, which had failed to disable agent and X11 forwarding.StrictHostKeyChecking no), the bastion could itself pretend to be the node, which is why host key checking still matters behind a bastion.Every ssh, scp, rsync -e ssh, git pull and every VS Code helper starts from zero: TCP, key exchange, authentication, through the bastion and then again to the node, plus a two-factor prompt if the cluster has one. Connection multiplexing keeps the first connection (the master) open and lets later clients ask it, over a local Unix socket, for a new channel on the already-authenticated connection.
Host gpu-node-* bastion
ControlMaster auto # use a master if one exists, otherwise become one
ControlPath ~/.ssh/cm/%C # where the socket lives; %C hashes local host, host, port, user and jump host
ControlPersist 4h # keep the master in the background after the first session ends
Predict: ten ssh gpu-node-01 true in a row through a bastion 40 ms away; how much faster is the multiplexed lane by the tenth command?
ssh gpu-node-01 true finds the socket and asks the master for a channel: one round trip to the bastion and back, 114 ms (median of nine).rsync and a git pull each get their own channel on the same authenticated pipe (illustrative names).ssh gpu-node-01 true: fresh logins every time against one master and nine reuses. After the first login, each command is one channel open on the master: 850 ms becomes 114 ms, 7.5 times faster.ssh -O exit stops the master, and every session riding it ends at once: a session running sleep 20 ended with exit status 255 after 18 ms.Ten commands: 8.4 s fresh against 1.9 s multiplexed. A reused channel needs one round trip to the bastion and back for the channel open and request (the node hop is inside the cluster), against roughly eight per hop for a login (section 1). On a cluster with two-factor login it also means one prompt instead of one per command. ssh -O check host says whether a master is running; -O exit stops it; -O conninfo and -O channels are new in 10.3 (the negotiated algorithms and traffic, and the open channels).
-O check, then -O exit, or a short ServerAliveInterval (section 9) so it notices.ControlPath in a directory only you can read (mkdir -m 700 ~/.ssh/cm); never in /tmp on a shared machine.ControlPersist bounds how long that lasts.rsync on the master slows your interactive shell, and one connection's congestion window caps total throughput. For bulk copies a separate connection (-o ControlMaster=no -o ControlPath=none) can be faster.sun_path[104] in its sys/un.h). %C is a fixed 40-character hash, which is why it is preferred to the older %r@%h:%p pattern. The lab hit the limit: its working directory alone was 120 characters, so it used the relative path ControlPath cm/%C.scp and sftp pass ControlMaster no: they use an existing master but no longer silently create one (10.0 release notes). 10.2 fixed a 10.1 bug that made sessions unusable with ControlPersist active, so avoid 10.1 with multiplexing.-vvv of a reuse, -O conninfo, -O channels, -O exitUser in your config for a host, but ssh host whoami still prints the old name. Why?ssh -O exit host and try again. The same trap catches changed forwarding options and agent forwarding: options of the original master apply.The notebook, TensorBoard or MLflow you want runs on a node your browser cannot reach. SSH carries TCP connections through its encrypted pipe as channels, in three directions. The flag says which end listens: -L and -D listen on the laptop, -R on the server. Fig. 8 steps through each forward as recorded on the lab.
-L to the notebook through the bastion. One command, ssh -N -L 30988:127.0.0.1:8888 gpu-node-01 (-N: no remote command, just forward; add -f to go to the background): the laptop listens on 30988 (IPv4 and IPv6) and each browser connection becomes a direct-tcpip channel to 127.0.0.1:8888 as seen from the node. With the token the notebook accepted it; without, it answered 403.-L to a Unix socket. The same forward to a socket in a private directory, -L 30986:/home/dev/.nb/nb.sock, which other users of the node cannot open.-D: one SOCKS proxy. ssh -N -D 30989 bastion reached the notebook bound to all interfaces on gpu-node-01:8889 by name, because the bastion resolved it (--socks5-hostname). Plain --socks5 failed with "Could not resolve host", and the loopback-bound notebook on 8888 was unreachable, since the proxy connects from the bastion.-R: the other way. -R 30991:127.0.0.1:30990 opened a port on the bastion's loopback that leads back to the laptop ("served from the laptop"); GatewayPorts no kept it off the network.ExitOnForwardFailure let the session run, so http://127.0.0.1:30985 reached the other program; with both taken, it exited 255.-D: resolve names on the far side. --socks5-hostname (or the URL scheme socks5h://, as in ALL_PROXY=socks5h://127.0.0.1:30989) sends the name to the bastion, which knows gpu-node-01; plain --socks5 resolves on the laptop and fails. And the proxy connects from the bastion, so a service bound to the node's loopback is unreachable through it; use -L to the node for that one.-R: the forwarded port opened on the bastion's loopback only, because the server's GatewayPorts defaults to no. Setting it to yes would expose your laptop's service to the whole network behind the bastion.ExitOnForwardFailure yes it exits 255. Recorded subtlety: -L 30985:... with no bind address listens on localhost in both IPv4 and IPv6; when only 127.0.0.1:30985 was taken, the IPv6 listener on [::1]:30985 still succeeded, so even ExitOnForwardFailure was satisfied, and http://127.0.0.1:30985 reached the other program. Bind explicitly (-L 127.0.0.1:30985:...) and pick ports nobody else uses: deriving the port from your user id (PORT=$((10000 + $(id -u) % 10000))) avoids collisions on shared nodes.| Flag | Listens on | Connects to | Use |
|---|---|---|---|
-L 30988:127.0.0.1:8888 | your laptop, port 30988 | 127.0.0.1:8888 as seen from the server | a notebook or dashboard on the node in your browser |
-L 30986:/home/dev/.nb/nb.sock | your laptop | a Unix socket on the server | the safest way to serve a notebook (below) |
-D 30989 | your laptop: a SOCKS5 proxy | whatever each request names, from the server | browse every internal service (Grafana, MLflow, Ray dashboard) with one tunnel |
-R 30991:127.0.0.1:30990 | the server, port 30991 | your laptop's 127.0.0.1:30990 | let the cluster reach something on your laptop (a licence server, a local API) |
The node ran the same notebook three ways: bound to loopback 127.0.0.1:8888, bound to all interfaces 0.0.0.0:8889, and on a Unix socket inside ~/.nb (mode 700). Then another user on the same node (alice) and another node tried to connect. Predict which of the three alice reaches.
127.0.0.1 "or any other user on that node reaches your kernel". Binding to 127.0.0.1 keeps other machines out (the second node was refused), but every user on the same node shares its loopback: alice reached the loopback-bound notebook and, with the token, would have run code as dev. What protects you on a shared login or compute node is the token (Jupyter's default; never disable it) or, better, a Unix socket in a directory only you can enter: alice got Permission denied. Jupyter Server can listen on a Unix socket (--ServerApp.sock, created with mode 0600 by default, Jupyter Server config), and ssh -L port:/path/to/socket forwards straight to it (recorded: fwd_L_unix).-L, -L to a socket, -D, -R, port taken~C opens a command line to add or cancel forwards, ~. kills a frozen session, ~I (10.3) prints connection information, ~? lists them.kubectl port-forward pod/nb 8888:8888 is the same idea through the API server (Kubernetes docs).AllowTcpForwarding, PermitOpen (which destinations), PermitListen (which -R ports), AllowStreamLocalForwarding, and per-key restrict or permitopen=. 10.4 and 10.5 fixed cases where DisableForwarding and restrict did not cover tunnel forwarding, which is off by default.ssh -L 8888:localhost:8888 gpu-node-01 and the browser shows a different notebook from the one you started. How?lsof -nP -iTCP:8888 -sTCP:LISTEN, use a unique port, bind 127.0.0.1 explicitly, and set ExitOnForwardFailure yes.A VPN, a NAT gateway or a firewall between you and the cluster forgets idle connections after a few minutes (AWS's NAT gateway after 350 seconds, as recorded on Networking foundations); a laptop sleeps; a server freezes. TCP alone will not tell you: with nothing to send, a dead connection looks exactly like a quiet one, and your terminal just hangs. Recorded: a session to gpu-node-01; three seconds in, the bastion was frozen (docker pause), so packets vanished without any refusal, as with a dead VPN.
ServerAliveInterval 30 with ServerAliveCountMax 3 (client; not TCPKeepAlive, whose kernel probes start only after 2 hours idle on Linux): after 30 s of silence ssh sends a request inside the encrypted connection and expects an answer; after 3 unanswered it disconnects (about 90 s). The probes also keep NAT and firewall state alive. Recorded with 2 and 2: exit after 5.0 s. Without it (the default is 0, off): still hanging after 30 s, when the script killed it.sbatch), and keep your interactive orchestration in tmux on the login node (section 13).TCPKeepAlive (on by default) asks the kernel for TCP keepalives, which on Linux start only after 2 hours idle (derived on Networking foundations: 7,200 s, then 9 probes 75 s apart). It is spoofable, does not go through the SSH layer, and is far too slow for a VPN that drops flows in minutes; ssh_config(5) itself points to ServerAliveInterval as the more robust mechanism.ClientAliveInterval is the server's mirror image (default 0, recorded in sshd -T): it reaps sessions whose client vanished. ChannelTimeout and UnusedConnectionTimeout (both none by default) close idle channels or connections without channels.All of these run over an SSH session channel; they differ in how many round trips each file costs and whether they can resume. Recorded through the bastion with 40 ms added (the same link as section 7), copying to gpu-node-01. Predict: how much slower is scp -r than rsync for 1,000 small files?
scp -r took 193.3 s for 1,000 files of 4 KiB (one run), rsync -a 1.6 s, and tar -cf - small | ssh node 'tar -xf -' 1.3 s (medians of 3). Since OpenSSH 9.0, scp speaks the SFTP protocol underneath (9.0 release notes), which pays several request round trips per file; rsync and tar stream.scp 4.5 s, rsync -a 4.1 s: similar, both bounded by one encrypted TCP stream.rsync --partial of the 64 MiB file was interrupted after 1.5 s, leaving 10,321,920 bytes on the node; rerunning it matched 10,320,136 of them and sent only the rest, in 4.4 s against 4.1 s for a full copy. On this fast link resuming saved bytes, not time (rsync still reads and checksums both sides); it pays off on slow, metered or flaky links, which is exactly when checkpoints get interrupted. Use rsync -avhP --partial (-P is --partial --progress). The laptop's rsync was macOS's openrsync (protocol 29); the node ran rsync 3.5.1.scp -r took minutes where rsync and a tar pipe took about a second.scp -O) asks the remote shell to expand file names, which has produced a series of bugs; 10.3 fixed one where legacy-mode downloads as root kept setuid bits, and 10.4 fixed two cases where a malicious server could make sftp or a remote-to-remote scp write outside the intended directory (release notes).A large enough quantum computer would break the elliptic-curve Diffie-Hellman behind every key exchange in section 1. None exists yet; OpenSSH's own estimate quotes "5-20 years, with many observers expecting them to arrive in the mid-2030s" (OpenSSH, Post-Quantum Cryptography). The danger is already real because of store now, decrypt later: someone who records your session today can decrypt it once they have such a machine. Signatures are different: a forged signature needs the quantum computer at the moment of the login, so there is no urgency for host and user keys yet.
Already the default. mlkem768x25519-sha256 (ML-KEM-768, NIST FIPS 203, plus X25519) has been OpenSSH's default since 10.0 (9 April 2025), "considerably faster than the previous default". That previous default, the hybrid sntrup761x25519-sha512@openssh.com, arrived in 9.0 (April 2022) and made SSH one of the first mainstream protocols with post-quantum key exchange on by default. It is specified in RFC 10042 (August 2026, Informational).
What it cost here (section 1, to scale): 2512 key-exchange bytes against 240, and no login time worth measuring on a link where a round trip costs more than the arithmetic (sntrup761 took 67 ms against ML-KEM's 61 ms, consistent with OpenSSH calling ML-KEM faster). Unlike TLS, where large post-quantum certificates threaten handshake size (TLS and certificates, section 8), SSH sends one host key and one signature, so even future post-quantum signatures add little.
The warning, recorded against gpu-node-02, an OpenSSH 9.7p1 server configured to offer only classic key exchange, as an old login node would. Since 10.1 the client warns when a connection uses a non-post-quantum key exchange; WarnWeakCrypto controls it, on by default:
The fix is to upgrade the server or re-enable its post-quantum algorithms (9.0 and later support sntrup761, 9.9 and later ML-KEM). If you cannot, silence it for that host only, as the OpenSSH page recommends: Match host gpu-node-02 then WarnWeakCrypto no-pq-kex. Do not hand-write KexAlgorithms or Ciphers lists copied from old hardening guides: frozen lists are how servers end up without the post-quantum default, exactly as this node was configured.
| When | What |
|---|---|
| OpenSSH 9.0, 8 April 2022 | Hybrid sntrup761x25519-sha512@openssh.com (Streamlined NTRU Prime plus X25519) becomes the default. |
| OpenSSH 9.9, 19 September 2024 | Adds mlkem768x25519-sha256. |
| OpenSSH 10.0, 9 April 2025 | mlkem768x25519-sha256 becomes the default. |
| OpenSSH 10.1, 6 October 2025 | The client warns on non-post-quantum key exchange (WarnWeakCrypto). |
| April 2026 | RFC 9941 documents sntrup761x25519-sha512 (Informational). |
| OpenSSH 10.4, 6 July 2026 | Experimental composite signature mldsa44-ed25519 (ML-DSA-44 plus Ed25519), off by default; keys with ssh-keygen -t mldsa44-ed25519. |
| August 2026 | RFC 10042 specifies mlkem768x25519-sha256, mlkem768nistp256-sha256 and mlkem1024nistp384-sha384 (Informational). |
Dates from the OpenSSH release notes and the RFC Editor.
Disclosed by Qualys on 1 July 2024 (advisory). If a client has not authenticated within LoginGraceTime (120 s by default), sshd gets a SIGALRM whose handler logs a message; on glibc-based Linux, syslog() calls malloc() and free(), which are not safe inside a signal handler, so an alarm arriving in the middle of an allocation leaves the heap inconsistent, and a patient attacker turns that into code execution as root, before authentication. Fixed in 9.8 (1 July 2024); the stop-gap if you could not upgrade was LoginGraceTime 0, trading the exploit for a denial of service. The lesson: an internet-facing sshd is attack surface no matter how good your keys are.
A regression of CVE-2006-5051, reintroduced in October 2020 (OpenSSH 8.5p1). Affected: portable OpenSSH below 4.4p1 (unless patched) and 8.5p1 up to but not including 9.8p1. OpenBSD was not vulnerable (its handler uses syslog_r()). How hard: Qualys needed about 10,000 tries on average to win the race; on 32-bit Linux with ASLR that took about 6 to 8 hours on average (9.8 release notes); 64-bit exploitation was "believed to be possible" but not demonstrated at disclosure.
Disclosed 18 December 2023 (terrapin-attack.com). An on-path attacker could tamper with the message sequence across the start of encryption without the integrity check noticing. The fix, strict key exchange in OpenSSH 9.6, aborts on any unexpected handshake message and resets sequence numbers after each key exchange, and only works when both sides support it. You can see it in the recorded handshake: the client lists kex-strict-c-v00@openssh.com in its KEXINIT, and the log says will use strict KEX ordering and resetting send seqnr 3.
chacha20-poly1305@openssh.com and against CBC ciphers with encrypt-then-MAC MACs; AES-GCM is not affected. Against OpenSSH the practical impact was small: deleting the EXT_INFO message, which disabled some keystroke-timing protections (OpenSSH 9.6 notes); some other implementations were hurt more. The researchers found at least 77% of internet SSH servers supported an exploitable mode at disclosure.A scanner reading OpenSSH_9.7 would flag this node for regreSSHion; Alpine's package 9.7_p1-r4 and later carries the fix, and -r5 also fixes the two 2025 CVEs (Alpine APKBUILD secfixes). Distributions backport; check the package, not the banner.
Since OpenSSH 9.8, sshd penalises source addresses that fail authentication, connect without authenticating, or crash it, and refuses them for a while, with no log-parsing daemon such as fail2ban. Recorded on gpu-node-01 with the default policy: six failed logins one second apart, all arriving from the bastion's address.
Attempts 5 and 6 were dropped before authentication. Note who got blocked: the bastion. Every user behind it shares that source address, so one broken script locks out the whole team. On nodes reached through a bastion or a NAT gateway, list those addresses in PerSourcePenaltyExemptList (and rate-limit on the bastion instead), or the protection becomes a self-inflicted outage.
PasswordAuthentication no and KbdInteractiveAuthentication no (unless your two-factor login uses keyboard-interactive), PermitRootLogin no, AllowGroups for who may log in at all.sshd -T in section 2): post-quantum first, ChaCha20-Poly1305 then AES-GCM; no CBC, no DSA, no finite-field Diffie-Hellman in sshd's defaults since 10.0. (The old page said non-EtM MACs are off by default: the recorded 10.5 default list still contains them, after the encrypt-then-MAC ones; with ChaCha20-Poly1305 or AES-GCM no separate MAC is used anyway.)MaxAuthTries (6), MaxStartups (10:30:100: start refusing 30% of unauthenticated connections at 10, all at 100), LoginGraceTime (120 s), PerSourcePenalties (on): defaults recorded above; tighten LoginGraceTime and MaxAuthTries on the internet-facing host.Match Group; AllowAgentForwarding no on the bastion if people use ProxyJump.sshd to port 2222 reduces log noise from scanners; it is not a security control (reasoning, not a measured claim).Not exposing port 22 at all is the strongest move: AWS Session Manager (no inbound port, IAM-authorised, audited; a ProxyCommand keeps ssh, -J and rsync working: AWS docs), a WireGuard or Tailscale overlay network (devices authenticate before any SSH packet flows), or Teleport (a certificate-issuing proxy with single sign-on and session recording). On a university cluster you rarely choose; ProxyJump plus ControlMaster is what makes a VPN plus two-factor login bearable.
| Fixed in | What |
|---|---|
| 9.9p2 (2025-02-18) | CVE-2025-26465: client impersonation with VerifyHostKeyDNS on (6.8p1 to 9.9p1). CVE-2025-26466: pre-authentication memory and CPU exhaustion through PING packets (9.5p1 to 9.9p1). Both found by Qualys. |
| 10.0 (2025-04-09) | DisableForwarding did not disable agent and X11 forwarding. Also: authentication code moved into its own sshd-auth binary, so the pre-authentication attack surface has a separate address space. |
| 10.1 (2025-10-06) | CVE-2025-61984: control characters in user names and ProxyCommand (section 5). |
| 10.3 (2026-04-02) | Shell metacharacters in user names validated too late for some %u uses; a certificate-principal matching bug with commas (authorized_keys path only); legacy scp setuid bits; PubkeyAcceptedAlgorithms not fully applied to ECDSA. |
| 10.4 (2026-07-06) | sftp and remote-to-remote scp writing outside the target directory; DisableForwarding did not override PermitTunnel; a client use-after-free if the server changes its host key during rekeying; minimum authentication delay not always enforced. |
| 10.5 (2026-08-11) | Agent locking against session-bind (section 6); a client use-after-free with multiplexed remote forwards; restrict now also covers tunnel forwarding. |
From the OpenSSH release notes and the CVE record for CVE-2025-61984. 10.5's notes say the team is "making more frequent releases" because many recent reports came from AI-assisted research and bugs found that way were being independently rediscovered by others: patch cadence matters more than it used to.
Click a line to see what it does and which recorded result backs it. Host names are placeholders; the lab's own config is src/lab/laptop.conf.
Lines explained: HostName and User, a hardware-key IdentityFile for the internet-facing hop, ControlMaster, ControlPath and ControlPersist per hop, %h expansion, ProxyJump in two hops, a separate UserKnownHostsFile with accept-new for nodes, then under Host *: IdentitiesOnly, AddKeysToAgent, ServerAliveInterval, ForwardAgent no, ExitOnForwardFailure, HashKnownHosts.
Jobs, steps and sbatch are on Slurm; what login and compute nodes are, on Cluster anatomy. The SSH part:
# inside the batch job (sbatch), on the compute node PORT=$((10000 + $(id -u) % 10000)) mkdir -m 700 -p ~/.nb jupyter lab --no-browser --ServerApp.sock=$HOME/.nb/nb-$SLURM_JOB_ID.sock & echo "on your laptop: ssh -N -L 127.0.0.1:$PORT:$HOME/.nb/nb-$SLURM_JOB_ID.sock $(hostname)" # on the laptop (ProxyJump in the config does the hops) ssh -N -o ExitOnForwardFailure=yes -L 127.0.0.1:8888:/home/you/.nb/nb-123.sock gpu-node-07
The pieces: a Unix socket in a private directory so other users on the node cannot reach the kernel (section 8), a port derived from your user id so you do not collide with colleagues, the exact command printed into the job's log so you can paste it, ExitOnForwardFailure so a taken port is an error. If the site does not allow SSH to compute nodes at all, use the scheduler's own route (Open OnDemand, or srun with a port forward through the login node).
srun --overlap --jobid=ID --pty bash starts a shell as a new step inside your running job; --overlap lets it share the job's resources with the steps already running (srun).ssh to the node works where the site runs pam_slurm_adopt: it refuses SSH to nodes where you have no running job and "adopts" your connection into the job's external step, so its processes are accounted and cleaned up with the job (pam_slurm_adopt).srun --pty dies with your connection. Run tmux on the login node for the shell you orchestrate from, so a closed laptop or dropped VPN loses nothing; avoid leaving it on compute nodes, where job cleanup kills stray processes.ControlMaster and a long ControlPersist to avoid repeated two-factor prompts.Host github.com, Hostname ssh.github.com, Port 443, User git (GitHub docs).sshd inside a container to get a shell; use docker exec, kubectl exec or apptainer shell, and kubectl port-forward instead of -L (containers themselves: Containers and isolation). This page's lab runs sshd in containers only because SSH is the subject.git config gpg.format ssh and user.signingkey; GitHub has verified SSH signatures since 23 August 2022 (GitHub changelog). An -sk key makes every signature need a touch.Most SSH failures are found by asking, in order: did TCP connect, did the key exchange agree, did the host key check pass, which keys were offered and why were they refused, and did the channel or forward open. ssh -v answers the first four from your side; the server log answers the "why" of authentication. Every message below was recorded in the lab; the Error decoder tab starts from the message and shows the log.
| You see | First command | Usual cause and fix |
|---|---|---|
Connection timed out / Connection refused | ssh -v (the Connecting to line), nc -vz host 22 | Wrong address or port, firewall, no route (a compute node without ProxyJump), sshd not running. |
Connection closed by ... port 22 right after connecting, or Connection reset before the banner | server log | PerSourcePenalties or MaxStartups refusing your address (section 12), TCP wrappers, a firewall. |
Unable to negotiate ... no matching key exchange method | ssh -vv (both KEXINIT lists), ssh -Q kex | An old server or a hand-written algorithm list; upgrade, or enable one algorithm for that host only. |
WARNING: connection is not using a post-quantum key exchange | ssh -v | grep kex: | Server without PQ key exchange (section 11). |
REMOTE HOST IDENTIFICATION HAS CHANGED | compare the printed fingerprint out of band | Rebuilt node or attack (section 3). Host certificates remove the routine case. |
Host key verification failed. | ssh -v, ssh-keygen -F host | Unknown host under StrictHostKeyChecking yes or BatchMode, or a changed key. |
Permission denied (publickey). | ssh -v (Offering lines), ssh -G host | grep identityfile, then the server log | Wrong key, wrong user, key not in authorized_keys, file permissions on ~/.ssh, or a certificate that is expired, for another principal, or revoked (section 4). The same message for a user that does not exist, so accounts cannot be enumerated. |
Too many authentication failures | ssh -v, ssh -Z (10.5) | Agent holds too many keys: IdentitiesOnly yes. |
stdio forwarding failed / channel 0: open failed: connect failed | ssh -v on the jump; can the bastion resolve and reach the node? | Node down or renamed, DNS on the bastion, AllowTcpForwarding no or PermitOpen on the bastion. |
bind [127.0.0.1]:8888: Address already in use | lsof -nP -iTCP:8888 -sTCP:LISTEN | Port taken; the session continues unless ExitOnForwardFailure yes (section 8). |
| Terminal frozen, no error | ~. to kill it | Path died silently: set ServerAliveInterval (section 9). |
Killed by signal 1. after a session through a jump host | nothing | Harmless: printed by the ProxyJump helper when the main session ends and closes it; -q or LogLevel ERROR hides it. |
| Old user, old options after editing the config | ssh -O check host | A multiplexing master predates the change: ssh -O exit host (section 7). |
Server side: sshd -T prints the effective configuration (with -C user=dev,host=...,addr=... to evaluate Match blocks), sshd -t checks the file before a reload, LogLevel VERBOSE logs key fingerprints and certificate IDs, and a second sshd -d -p 2222 runs one debug connection in the foreground without touching the real service.
Walk me through what happens when you type ssh gpu-node-01 through a bastion. The client reads its config, finds ProxyJump bastion, and starts a helper ssh -W gpu-node-01:22 bastion. That helper opens TCP to the bastion, exchanges version strings and KEXINIT lists, runs the key exchange (by default the hybrid ML-KEM-768 plus X25519), verifies the bastion's host key signature against known_hosts or a host CA, switches on encryption, authenticates with a key or certificate whose signature covers the session identifier, and opens a direct-tcpip channel to the node's port 22. Through that channel the main client runs a second, independent handshake and authentication with the node, opens a session channel and requests a shell. The bastion only relays ciphertext. About eight round trips per login, doubled by the hop, which is why ControlMaster matters.
Why is agent forwarding dangerous, and what do you use instead? The remote sshd exposes a socket that forwards signing requests to your local agent. Anyone with root on that machine, or running as your user, can use it while you are connected to authenticate as you anywhere your key is accepted; your private key never leaves your laptop but it does not need to. Use ProxyJump, which relays an encrypted stream and never gives the bastion signing ability. If forwarding is unavoidable, use destination-constrained keys (ssh-add -h) and confirmation (ssh-add -c).
How does SSH prevent a man in the middle, and where is it weak? The server signs the key exchange hash with its host key, and the client checks that key against what it knows. The weak points are the first connection (trust on first use: the user must verify the fingerprint) and habituation to "host key changed" warnings on rebuilt machines. Host certificates fix both: the client trusts a CA key, and any properly signed host key for that name is accepted without a prompt. SSHFP records with DNSSEC are an alternative.
What are SSH certificates and why would a company use them? A CA signs a user's public key together with a key ID, principals, a validity window, a serial and options. Servers trust the CA key instead of per-user authorized_keys. Onboarding and offboarding become CA policy, certificates expire on their own (hours), logs name the certificate, and a KRL handles emergencies. Host certificates do the same for server identity. The CA key becomes the crown jewel, usually behind single sign-on (Vault, Teleport).
Your notebook tunnel works but a colleague says they can reach your notebook too. How? They are on the same node: loopback is shared by all local users, so binding to 127.0.0.1 does not isolate you from them, only from other machines. Or the notebook was bound to 0.0.0.0. Keep a token, and preferably serve on a Unix socket in a mode-700 directory and forward to it with -L port:/path/socket.
What does post-quantum key exchange protect against in SSH today, and what does it not? It protects recorded sessions against future decryption (store now, decrypt later), which is why OpenSSH made a hybrid the default in 2022 and ML-KEM in 2025. It does not protect authentication against a future quantum attacker, but that attack would have to happen live, so there is time; experimental ML-DSA composite signatures arrived in 10.4. The hybrid construction means it is no weaker than X25519 even if ML-KEM were broken.
Explain regreSSHion in two minutes. An async-signal-safety bug in sshd's login-grace-time alarm handler, which called syslog (and through it malloc) from a signal handler on glibc Linux. Interrupting an allocation at the right moment corrupts the heap; winning the race, which took about 10,000 tries on average, led to root code execution before authentication. A 2006 bug reintroduced in 8.5p1 (2020), fixed in 9.8 (July 2024). Mitigation without patching: LoginGraceTime 0. Lesson: pre-auth bugs bypass key-only authentication, so limit exposure of sshd.
| Version and date | Change that affects you |
|---|---|
| 9.8 (2024-07-01) | regreSSHion fixed; PerSourcePenalties on by default; sshd split into listener and per-session binaries. |
| 9.9 (2024-09-19) | mlkem768x25519-sha256 added. |
| 10.0 (2025-04-09) | ML-KEM hybrid default; DSA removed; finite-field DH out of sshd defaults; sshd-auth binary; scp and sftp no longer create multiplexing masters; version string OpenSSH_10.0 confuses naive OpenSSH_1* matching. |
| 10.1 (2025-10-06) | Warning for non-PQ key exchange (WarnWeakCrypto); agent sockets under ~/.ssh/agent; ssh-add expires certificates; server logs refused certificates in detail; RefuseConnection config option; XMSS keys removed. |
| 10.2 (2025-10-10) | Bug-fix release for the ControlPersist breakage in 10.1. |
| 10.3 (2026-04-02) | Agent forwarding uses the IANA names of the agent standard; ~I, -O conninfo, -O channels; -J name validation; empty-principal certificate change; invaliduser penalty. |
| RFC 9987 (May 2026) | The SSH agent protocol, Standards Track. |
| 10.4 (2026-07-06) | Experimental mldsa44-ed25519 signatures; stricter transport during rekey; sshd -G prints mixed-case names. |
| RFC 10042 (August 2026) | ML-KEM hybrid key exchange for SSH. |
| 10.5 (2026-08-11) | ssh -Z; low-friction FIDO keys tried first; requires ECC with NIST P-521 in libcrypto when built (matters for custom container builds); agent-lock fix. |
All from the OpenSSH release notes and the RFC Editor, checked 5 October 2026.
Recorded and checked on 5 October 2026. Lab scripts, raw outputs and the build are in this page's src/ folder in the knowledge base repository.
Start from what SSH printed. Each message below was produced on purpose in the lab and is shown with its recorded log, what it means, the command that tells you more, and the fix. Type part of your message to filter.
From an SSH error message to its cause, the command that tells you more, the fix and the recorded log. 5 min, or when stuck
The overview: one LLM request on the wire; its Protocol atlas has the SSH entry and timeline, its Failure lab the shared failures. 33 min
Login and compute nodes, jobs, steps, sbatch and srun: the cluster that section 13 reaches over SSH.
Why docker exec and kubectl exec replace an sshd in a container.
X.509 certificates and CAs (the web's version of section 4), post-quantum key exchange and signatures in TLS. 45 min
TCP, round trips, keepalives and NAT idle timeouts behind section 9; moving big checkpoints. 49 min
API keys, OAuth, mTLS and short-lived credentials: the same ideas as SSH certificates for services and agents. 42 min
DNSSEC, which SSHFP needs to mean anything; resolution on the bastion versus the laptop (socks5h). 45 min
Every version, default and fix on this page traces here. Read 9.8 to 10.5. 1 h
Why hybrid key exchange, the 10.1 warning, how to silence it per host. 10 min
Every keyword; search rather than read. reference
Sections CERTIFICATES and KEY REVOCATION LISTS. 20 min
The protocol: architecture, authentication, transport, connection. RFC 4253 sections 6 to 8 first. 3 h for all four
The SSH agent protocol, including destination constraints and forwarding. 45 min
The certificate format, field by field. 15 min
A signal-handler race turned into root, step by step. 40 min
Prefix truncation on the SSH handshake, and strict key exchange. 20 min
SSH to nodes where your job runs; --overlap. 20 min
What the remote needs (glibc 2.28+). 10 min
A production CA for user and host certificates. 25 min
SSH with no inbound port. 15 min