OpenSSH Knowledge Patch
Use this patch
- Identify both client and server versions before changing algorithms,
authentication, forwarding, agent handling, or file-transfer automation.
- Separate client behavior from server behavior. Defaults and validation may
have changed on only one side.
- Read the matching topic reference before editing
ssh_config,
sshd_config, packaging, output parsers, or transfer scripts.
- Preserve a compatibility exception only when a specific peer requires it;
never restore removed algorithms as a general default.
- Treat fixes for memory safety, authentication denial of service, forwarded
agent restrictions, and transfer containment as upgrade requirements.
- Re-test configuration dumps and human-readable command output before
depending on literal names, casing, or formatting.
Reference index
| Reference |
Topics |
| cryptography-and-keys.md |
Algorithm removals and defaults, warnings, composite signatures, exact allowlists, revocation, FIDO, PKCS#8 |
| configuration-and-authentication.md |
Packaging, sandboxing, matching, expansion, identity validation, authorization, forwarding, GSSAPI, penalties |
| connections-and-agents.md |
Rekeying, multiplexing, QoS, timeouts, agent lifecycle, forwarding extensions and security fixes |
| file-transfer.md |
scp, sftp, control masters, destination containment, internal-sftp, listings, mode preservation |
Breaking changes and deprecations
Remove assumptions about legacy algorithms
- Treat DSA signatures as unavailable; support was removed entirely.
- Do not assume the server offers finite-field
diffie-hellman-group* or
diffie-hellman-group-exchange-* methods by default. The client default did
not change at the same time.
- Do not depend on compiled-in groups when a present moduli file contains no
suitable groups; that condition no longer falls back.
- Remove experimental XMSS keys before upgrading from an older installation.
- Upgrade or replace peers that cannot rekey.
Install the split authentication executable
Per-connection user authentication runs in sshd-auth, separately from
sshd-session.
- Include
sshd-auth in portable packages, custom install manifests,
containers, and executable integrity policies.
- Include it when mapping authentication-phase log messages to executables.
- Diagnose a missing binary as a packaging defect, not an
sshd_config
failure.
Make Linux sandbox support an explicit build decision
On Linux seccomp builds, failure to enable seccomp or NO_NEW_PRIVS is fatal.
- Verify that both facilities work in the deployed runtime.
- Disable the sandbox at configure time when the platform cannot provide them.
- Do not rely on the former log-and-continue behavior.
Enforce rekey interoperability
Clients and servers disconnect a peer that sends a non-key-exchange message
during post-authentication rekey. Fix implementations that violate RFC 4253
section 7.1. Upgrade clients for the use-after-free fix when a server changes
its host key during rekey.
Upgrade for security-sensitive forwarding
- Upgrade agents that may be forwarded. A locked agent must still process
session-bind@openssh.com so remote users cannot bypass restrictions on
operations intended to be local-only, including adding PKCS#11 tokens or
using destination-restricted keys.
- Upgrade clients whose automation adds remote forwards concurrently through a
shared control connection; the multiplexed path had a realloc use-after-free
race while another remote-forward request was pending.
Upgrade for transfer containment
- Upgrade clients that download from untrusted servers:
sftp host:/path .
now prevents the server from choosing an unexpected local destination.
- Upgrade remote-to-remote
scp clients so a malicious server cannot write
into the parent of the intended target directory.
- Audit
internal-sftp command lines with ten or more arguments. Older
releases silently discarded the tenth and later arguments, potentially
dropping a security option.
Avoid the ControlPersist terminal regression
Do not leave interactive terminal users on the affected release when
ControlPersist is active; the following release fixes the terminal state.
High-use cryptography and key changes
Account for post-quantum key-exchange defaults
- Expect
mlkem768x25519-sha256 to be the default key exchange.
- Expect cipher preference to be ChaCha20/Poly1305, AES-GCM 128/256, then
AES-CTR 128/192/256.
- Expect a default-on warning when negotiation selects a non-post-quantum key
exchange; control it with
WarnWeakCrypto.
- Plan to remove SHA1 SSHFP dependencies. The client warns that SHA1 records
will eventually be ignored, and
ssh-keygen -r emits only SHA256 records.
Opt in to the experimental composite signature
Generate the ML-DSA 44 and Ed25519 composite key type with:
ssh-keygen -t mldsa44-ed25519
The scheme is disabled by default. Add it explicitly to applicable lists such
as HostKeyAlgorithms and PubkeyAcceptedAlgorithms; generating a key does
not enable negotiation.
Keep algorithm policy exact
- Expect invalid cipher and MAC lists to fail during configuration processing,
not later at runtime.
- An ECDSA name in
PubkeyAcceptedAlgorithms or
HostbasedAcceptedAlgorithms admits only that exact ECDSA algorithm.
- Read cryptography-and-keys.md before
changing revocation files, resident-key downloads, or PKCS#8 workflows.
High-use configuration and authentication changes
Use the expanded match criteria
Use Match version in client or server configuration. On clients, also use
Match sessiontype and Match command; session types are shell, exec,
subsystem, and none.
Match version OpenSSH_10.*
SetEnv GENERATION=10
Use Match tagged "" or Match command "" when an empty value must match
explicitly.
Refuse a destination from client configuration
Use RefuseConnection inside an active Host or Match block to stop
processing with a useful error.
Match host old.example
RefuseConnection "old.example is retired; use new.example"
Apply expansion and authorization globs deliberately
- Percent-token and environment expansion applies to client
SetEnv and
User; %r and %C are excluded from User to avoid self-reference.
- Server
AuthorizedKeysFile and AuthorizedPrincipalsFile accept glob(3)
patterns.
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/*
Re-check forwarding and GSSAPI policy
- Rely on
DisableForwarding=yes to override PermitTunnel=yes only on a
server with the fixed behavior. On older servers, set PermitTunnel=no.
- Do not rely on
GSSAPIStrictAcceptorCheck for a server joined to Windows
Active Directory; it is ineffective there.
- Upgrade GSSAPI-enabled servers for the pre-authentication denial-of-service
fix and restored minimum authentication delays.
MaxAuthTries did not
mitigate the older path, but PerSourcePenalties applied.
- Use
invaliduser and floating-point durations for finer penalties.
PerSourcePenalties invaliduser:10s authfail:0.5s
Re-test configuration consumers
sshd -G emits mixed-case directive names such as PubkeyAuthentication.
Parsers must accept the emitted casing instead of matching lowercase names
literally.
High-use agent and connection changes
Handle the agent socket migration
Local and forwarded agent sockets use hostname-hashed paths under
~/.ssh/agent instead of /tmp.
- Use
ssh-agent -T only when the legacy /tmp layout is required.
- Use
-U to suppress stale-socket cleanup, -u for cleanup only, and -uu
to ignore the hostname during cleanup.
- Remove tooling assumptions that agent sockets always live under
/tmp.
Control key lifetime and agent operations
- Send
SIGUSR1 to an agent to clear all keys.
- Use systemd-style socket activation only with
LISTEN_PID/LISTEN_FDS and
ssh-agent -d or -D without an explicit socket path.
- Certificates loaded into an agent expire five minutes after their own
expiry; pass
ssh-add -N to disable this automatic lifetime.
- Use
ssh-add -Q to report supported agent extensions.
Re-test transport policy
- Interactive-only traffic defaults to EF, non-interactive traffic uses the
operating-system default, and the selection changes as channels change.
- Remove
lowdelay, reliability, and throughput; they are ignored.
- Server
IPQoS uses first-match-wins precedence and accepts the VA codepoint.
UnusedConnectionTimeout begins only after the final channel closes.
High-use file-transfer changes
scp and sftp invoke ssh with ControlMaster no: they reuse an existing
master but do not create one implicitly.
sftp ls -ln prints numeric user and group IDs. Remove workarounds for the
earlier name output.
- For root downloads using legacy
scp -O, pass -p when preserving setuid or
setgid bits is intentional; otherwise those bits are cleared.
Migration checklist
- Install and permit execution of
sshd-auth.
- Test Linux sandbox initialization in the deployment runtime.
- Validate cipher, MAC, and exact ECDSA algorithm lists.
- Exercise post-authentication rekey with non-OpenSSH peers.
- Test
sshd -G consumers with mixed-case directive names.
- Audit long
internal-sftp invocations and untrusted transfer paths.
- Test agent discovery, expiry, locking, and forwarded-agent restrictions.
- Review GSSAPI, forwarding, certificate-principal, identity-validation, and
per-source penalty policy in the detailed references.
1---2name: openssh-knowledge-patch3description: OpenSSH4license: MIT5---678# OpenSSH Knowledge Patch910## Use this patch11121. Identify both client and server versions before changing algorithms,13 authentication, forwarding, agent handling, or file-transfer automation.142. Separate client behavior from server behavior. Defaults and validation may15 have changed on only one side.163. Read the matching topic reference before editing `ssh_config`,17 `sshd_config`, packaging, output parsers, or transfer scripts.184. Preserve a compatibility exception only when a specific peer requires it;19 never restore removed algorithms as a general default.205. Treat fixes for memory safety, authentication denial of service, forwarded21 agent restrictions, and transfer containment as upgrade requirements.226. Re-test configuration dumps and human-readable command output before23 depending on literal names, casing, or formatting.2425## Reference index2627| Reference | Topics |28| --- | --- |29| [cryptography-and-keys.md](references/cryptography-and-keys.md) | Algorithm removals and defaults, warnings, composite signatures, exact allowlists, revocation, FIDO, PKCS#8 |30| [configuration-and-authentication.md](references/configuration-and-authentication.md) | Packaging, sandboxing, matching, expansion, identity validation, authorization, forwarding, GSSAPI, penalties |31| [connections-and-agents.md](references/connections-and-agents.md) | Rekeying, multiplexing, QoS, timeouts, agent lifecycle, forwarding extensions and security fixes |32| [file-transfer.md](references/file-transfer.md) | `scp`, `sftp`, control masters, destination containment, `internal-sftp`, listings, mode preservation |3334## Breaking changes and deprecations3536### Remove assumptions about legacy algorithms3738- Treat DSA signatures as unavailable; support was removed entirely.39- Do not assume the server offers finite-field `diffie-hellman-group*` or40 `diffie-hellman-group-exchange-*` methods by default. The client default did41 not change at the same time.42- Do not depend on compiled-in groups when a present moduli file contains no43 suitable groups; that condition no longer falls back.44- Remove experimental XMSS keys before upgrading from an older installation.45- Upgrade or replace peers that cannot rekey.4647### Install the split authentication executable4849Per-connection user authentication runs in `sshd-auth`, separately from50`sshd-session`.5152- Include `sshd-auth` in portable packages, custom install manifests,53 containers, and executable integrity policies.54- Include it when mapping authentication-phase log messages to executables.55- Diagnose a missing binary as a packaging defect, not an `sshd_config`56 failure.5758### Make Linux sandbox support an explicit build decision5960On Linux seccomp builds, failure to enable seccomp or `NO_NEW_PRIVS` is fatal.6162- Verify that both facilities work in the deployed runtime.63- Disable the sandbox at configure time when the platform cannot provide them.64- Do not rely on the former log-and-continue behavior.6566### Enforce rekey interoperability6768Clients and servers disconnect a peer that sends a non-key-exchange message69during post-authentication rekey. Fix implementations that violate RFC 425370section 7.1. Upgrade clients for the use-after-free fix when a server changes71its host key during rekey.7273### Upgrade for security-sensitive forwarding7475- Upgrade agents that may be forwarded. A locked agent must still process76 `session-bind@openssh.com` so remote users cannot bypass restrictions on77 operations intended to be local-only, including adding PKCS#11 tokens or78 using destination-restricted keys.79- Upgrade clients whose automation adds remote forwards concurrently through a80 shared control connection; the multiplexed path had a realloc use-after-free81 race while another remote-forward request was pending.8283### Upgrade for transfer containment8485- Upgrade clients that download from untrusted servers: `sftp host:/path .`86 now prevents the server from choosing an unexpected local destination.87- Upgrade remote-to-remote `scp` clients so a malicious server cannot write88 into the parent of the intended target directory.89- Audit `internal-sftp` command lines with ten or more arguments. Older90 releases silently discarded the tenth and later arguments, potentially91 dropping a security option.9293### Avoid the `ControlPersist` terminal regression9495Do not leave interactive terminal users on the affected release when96`ControlPersist` is active; the following release fixes the terminal state.9798## High-use cryptography and key changes99100### Account for post-quantum key-exchange defaults101102- Expect `mlkem768x25519-sha256` to be the default key exchange.103- Expect cipher preference to be ChaCha20/Poly1305, AES-GCM 128/256, then104 AES-CTR 128/192/256.105- Expect a default-on warning when negotiation selects a non-post-quantum key106 exchange; control it with `WarnWeakCrypto`.107- Plan to remove SHA1 SSHFP dependencies. The client warns that SHA1 records108 will eventually be ignored, and `ssh-keygen -r` emits only SHA256 records.109110### Opt in to the experimental composite signature111112Generate the ML-DSA 44 and Ed25519 composite key type with:113114```sh115ssh-keygen -t mldsa44-ed25519116```117118The scheme is disabled by default. Add it explicitly to applicable lists such119as `HostKeyAlgorithms` and `PubkeyAcceptedAlgorithms`; generating a key does120not enable negotiation.121122### Keep algorithm policy exact123124- Expect invalid cipher and MAC lists to fail during configuration processing,125 not later at runtime.126- An ECDSA name in `PubkeyAcceptedAlgorithms` or127 `HostbasedAcceptedAlgorithms` admits only that exact ECDSA algorithm.128- Read [cryptography-and-keys.md](references/cryptography-and-keys.md) before129 changing revocation files, resident-key downloads, or PKCS#8 workflows.130131## High-use configuration and authentication changes132133### Use the expanded match criteria134135Use `Match version` in client or server configuration. On clients, also use136`Match sessiontype` and `Match command`; session types are `shell`, `exec`,137`subsystem`, and `none`.138139```sshconfig140Match version OpenSSH_10.*141 SetEnv GENERATION=10142```143144Use `Match tagged ""` or `Match command ""` when an empty value must match145explicitly.146147### Refuse a destination from client configuration148149Use `RefuseConnection` inside an active `Host` or `Match` block to stop150processing with a useful error.151152```sshconfig153Match host old.example154 RefuseConnection "old.example is retired; use new.example"155```156157### Apply expansion and authorization globs deliberately158159- Percent-token and environment expansion applies to client `SetEnv` and160 `User`; `%r` and `%C` are excluded from `User` to avoid self-reference.161- Server `AuthorizedKeysFile` and `AuthorizedPrincipalsFile` accept `glob(3)`162 patterns.163164```sshconfig165AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/*166```167168### Re-check forwarding and GSSAPI policy169170- Rely on `DisableForwarding=yes` to override `PermitTunnel=yes` only on a171 server with the fixed behavior. On older servers, set `PermitTunnel=no`.172- Do not rely on `GSSAPIStrictAcceptorCheck` for a server joined to Windows173 Active Directory; it is ineffective there.174- Upgrade GSSAPI-enabled servers for the pre-authentication denial-of-service175 fix and restored minimum authentication delays. `MaxAuthTries` did not176 mitigate the older path, but `PerSourcePenalties` applied.177- Use `invaliduser` and floating-point durations for finer penalties.178179```sshconfig180PerSourcePenalties invaliduser:10s authfail:0.5s181```182183### Re-test configuration consumers184185`sshd -G` emits mixed-case directive names such as `PubkeyAuthentication`.186Parsers must accept the emitted casing instead of matching lowercase names187literally.188189## High-use agent and connection changes190191### Handle the agent socket migration192193Local and forwarded agent sockets use hostname-hashed paths under194`~/.ssh/agent` instead of `/tmp`.195196- Use `ssh-agent -T` only when the legacy `/tmp` layout is required.197- Use `-U` to suppress stale-socket cleanup, `-u` for cleanup only, and `-uu`198 to ignore the hostname during cleanup.199- Remove tooling assumptions that agent sockets always live under `/tmp`.200201### Control key lifetime and agent operations202203- Send `SIGUSR1` to an agent to clear all keys.204- Use systemd-style socket activation only with `LISTEN_PID`/`LISTEN_FDS` and205 `ssh-agent -d` or `-D` without an explicit socket path.206- Certificates loaded into an agent expire five minutes after their own207 expiry; pass `ssh-add -N` to disable this automatic lifetime.208- Use `ssh-add -Q` to report supported agent extensions.209210### Re-test transport policy211212- Interactive-only traffic defaults to EF, non-interactive traffic uses the213 operating-system default, and the selection changes as channels change.214- Remove `lowdelay`, `reliability`, and `throughput`; they are ignored.215- Server `IPQoS` uses first-match-wins precedence and accepts the VA codepoint.216- `UnusedConnectionTimeout` begins only after the final channel closes.217218## High-use file-transfer changes219220- `scp` and `sftp` invoke `ssh` with `ControlMaster no`: they reuse an existing221 master but do not create one implicitly.222- `sftp ls -ln` prints numeric user and group IDs. Remove workarounds for the223 earlier name output.224- For root downloads using legacy `scp -O`, pass `-p` when preserving setuid or225 setgid bits is intentional; otherwise those bits are cleared.226227## Migration checklist228229- Install and permit execution of `sshd-auth`.230- Test Linux sandbox initialization in the deployment runtime.231- Validate cipher, MAC, and exact ECDSA algorithm lists.232- Exercise post-authentication rekey with non-OpenSSH peers.233- Test `sshd -G` consumers with mixed-case directive names.234- Audit long `internal-sftp` invocations and untrusted transfer paths.235- Test agent discovery, expiry, locking, and forwarded-agent restrictions.236- Review GSSAPI, forwarding, certificate-principal, identity-validation, and237 per-source penalty policy in the detailed references.