OpenSSH Knowledge Patch
Use this patch
- Identify the exact client, server, and agent versions before changing
algorithms, authentication, forwarding, multiplexing, or file-transfer
automation.
- Keep client and server behavior separate. Several defaults and validations
changed on only one side.
- Read the matching topic reference before editing
ssh_config,
sshd_config, packages, output parsers, or automation.
- Preserve compatibility exceptions only for peers that require them. Do not
restore removed algorithms as broad defaults.
- Treat memory-safety, authentication, containment, and agent-binding fixes as
upgrade requirements.
- Test effective configuration, rekey, multiplexing, and transfers against the
actual peer implementations used in production.
Reference index
| Reference |
Topics |
| cryptography-and-keys.md |
Algorithm removal and defaults, composite signatures, certificates, revocation, FIDO, and key formats |
| configuration-and-authentication.md |
Packaging, sandboxing, effective configuration, matching, identity validation, authorization, forwarding, GSSAPI, and penalties |
| connections-and-agents.md |
Rekey, QoS, timeouts, multiplexing, agent sockets, key lifetime, extensions, and forwarding boundaries |
| file-transfer.md |
scp, sftp, destination containment, internal-sftp, listings, control masters, and mode preservation |
Breaking changes and deprecations
Remove legacy cryptography assumptions
- Treat DSA signatures as unavailable from OpenSSH 10.0.
- Do not assume a server offers finite-field
diffie-hellman-group* or
diffie-hellman-group-exchange-* methods by default. The corresponding
client default was not removed at the same time.
- Do not expect compiled-in groups to rescue a present moduli file that has no
suitable groups.
- Remove experimental XMSS keys before deploying 10.1 or later.
- Upgrade or replace peers that cannot rekey before using 10.3 or later.
Install the authentication executable
OpenSSH 10.0 moves per-connection user authentication from sshd-session to
sshd-auth.
- Include
sshd-auth in portable packages, images, custom install manifests,
executable allowlists, and integrity policies.
- Expect authentication-phase log messages to be attributed to
sshd-auth.
- Diagnose a missing
sshd-auth as a packaging defect rather than an
authentication-policy failure.
Make Linux sandbox support explicit
On OpenSSH 10.4 Linux builds that use the seccomp sandbox, failure to enable
seccomp or NO_NEW_PRIVS prevents sshd from continuing.
- Confirm both facilities work in the deployed runtime.
- Disable the sandbox at configure time if the platform cannot provide them.
- Do not depend on the former log-and-continue behavior.
Enforce rekey interoperability
OpenSSH 10.4 disconnects a peer that sends a non-key-exchange message during a
post-authentication rekey.
- Fix peers that violate RFC 4253 section 7.1 instead of suppressing the
disconnect.
- Upgrade clients to receive the fix for a use-after-free triggered when a
server changes its host key during rekey.
- Treat peers that cannot rekey as incompatible with OpenSSH 10.3 and later.
Upgrade agents used through forwarding
Upgrade forwarded agents to OpenSSH 10.5. Earlier agents could refuse
session-bind@openssh.com while locked, allowing a remote user of the
forwarded agent to perform operations that should have remained local-only.
Prioritize agents that can add PKCS#11 tokens or hold destination-restricted
keys.
Upgrade concurrent multiplexing clients
OpenSSH 10.5 fixes a potential realloc use-after-free when automation adds a
remote forwarding through the local multiplexing socket while another
remote-forward open request is pending. Upgrade clients that mutate remote
forwards concurrently over a shared control connection.
Upgrade for transfer containment
- Upgrade clients that download from untrusted servers.
sftp host:/path .
now prevents the server from selecting 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 invocations with ten or more arguments. Older releases
discard the tenth and later arguments and can silently lose a security
option.
Avoid the ControlPersist terminal regression
Do not leave interactive users on OpenSSH 10.1 when ControlPersist is active.
OpenSSH 10.2 fixes the regression that could leave terminal sessions unusable.
High-use cryptography and key changes
Account for new negotiation defaults
- Expect
mlkem768x25519-sha256 to be the default key exchange from 10.0.
- Expect cipher preference to be ChaCha20/Poly1305, AES-GCM 128/256, then
AES-CTR 128/192/256.
- From 10.1, expect a default-on warning when negotiation selects a
non-post-quantum key exchange; configure it with
WarnWeakCrypto.
- Plan to remove dependencies on SHA1 SSHFP records. The client warns that they
will eventually be ignored, and
ssh-keygen -r emits only SHA256 records.
Opt in to composite signatures
OpenSSH 10.4 supports an experimental ML-DSA 44 and Ed25519 composite key type.
It remains disabled by default.
ssh-keygen -t mldsa44-ed25519
Add the type explicitly to applicable lists such as HostKeyAlgorithms and
PubkeyAcceptedAlgorithms; generating a key does not enable negotiation.
Keep algorithm and key policy exact
- Expect invalid cipher and MAC lists to fail while configuration is processed
instead of later at runtime.
- On 10.3 or later, an ECDSA name in
PubkeyAcceptedAlgorithms or
HostbasedAcceptedAlgorithms admits only that exact ECDSA algorithm.
- Read cryptography-and-keys.md before
changing certificate principals, revocation files, resident-key downloads,
or PKCS#8 workflows.
High-use configuration and authentication changes
Match new connection properties
Use Match version in client or server configuration. Client configuration can
also match sessiontype and command; session types are shell, exec,
subsystem, and none.
Match version OpenSSH_10.*
SetEnv GENERATION=10
Use Match tagged "" or Match command "" when the empty value must match
explicitly.
Refuse destinations from configuration
Use RefuseConnection inside an active client Host or Match block to abort
configuration processing with a useful error.
Match host old.example
RefuseConnection "old.example is retired; use new.example"
Apply expansion and authorization globs deliberately
- Client
SetEnv and User values expand percent tokens and environment
variables, but User excludes the self-referential %r and %C tokens.
- Server
AuthorizedKeysFile and AuthorizedPrincipalsFile accept glob(3)
patterns.
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/*
Re-check forwarding and GSSAPI policy
- On 10.4,
DisableForwarding=yes overrides PermitTunnel=yes. On older
servers, set PermitTunnel=no explicitly when tunnels must be prohibited.
- Do not depend 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.
- Use
PerSourcePenalties, not MaxAuthTries, to mitigate the older GSSAPI
denial-of-service path.
High-use agent and connection changes
Handle the agent socket migration
From 10.1, 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 to perform 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 a 10.0-or-later agent to clear all keys.
- Use systemd-style socket activation only when
LISTEN_PID and LISTEN_FDS
are set and ssh-agent runs with -d or -D without an explicit path.
- Expect certificates loaded from 10.1 onward to be removed five minutes after
their certificate expiry. Pass
ssh-add -N to disable that lifetime.
- Use
ssh-add -Q on 10.3 or later to query supported agent extensions.
Re-test transport behavior
- Interactive-only traffic defaults to EF; non-interactive traffic uses the
operating-system default, and selection changes as channel types change.
- Remove legacy
lowdelay, reliability, and throughput values because they
are ignored.
- On 10.3 servers, expect first-match-wins
IPQoS precedence and support for
the VA codepoint.
- Expect
UnusedConnectionTimeout to begin only after the final channel closes
on 10.3 or later.
High-use file-transfer changes
- Expect
scp and sftp to invoke ssh with ControlMaster no. They reuse an
existing master but do not create one implicitly.
- Expect
sftp ls -ln on 10.4 to print numeric user and group IDs; remove
workarounds for the earlier name output.
- For root downloads using legacy
scp -O, pass -p only when preserving
setuid or setgid bits is intentional. From 10.3, those bits are otherwise
cleared.
Validation checklist
- Confirm packages and images install and can execute
sshd-auth.
- Exercise seccomp and
NO_NEW_PRIVS initialization in the deployment runtime.
- Validate algorithm lists and exact ECDSA allowlists before rollout.
- Exercise post-authentication rekey against every non-OpenSSH peer.
- Make
sshd -G consumers accept mixed-case directive names.
- Audit long
internal-sftp commands and transfers from untrusted servers.
- Test agent discovery, cleanup, certificate expiry, locking, and forwarding.
- Reproduce concurrent remote-forward changes over multiplexed connections.
- Review GSSAPI, forwarding, principal, and per-source penalty policy in the
detailed references.
1---2name: openssh-knowledge-patch-23description: OpenSSH4license: MIT5---678# OpenSSH Knowledge Patch910## Use this patch11121. Identify the exact client, server, and agent versions before changing13 algorithms, authentication, forwarding, multiplexing, or file-transfer14 automation.152. Keep client and server behavior separate. Several defaults and validations16 changed on only one side.173. Read the matching topic reference before editing `ssh_config`,18 `sshd_config`, packages, output parsers, or automation.194. Preserve compatibility exceptions only for peers that require them. Do not20 restore removed algorithms as broad defaults.215. Treat memory-safety, authentication, containment, and agent-binding fixes as22 upgrade requirements.236. Test effective configuration, rekey, multiplexing, and transfers against the24 actual peer implementations used in production.2526## Reference index2728| Reference | Topics |29| --- | --- |30| [cryptography-and-keys.md](references/cryptography-and-keys.md) | Algorithm removal and defaults, composite signatures, certificates, revocation, FIDO, and key formats |31| [configuration-and-authentication.md](references/configuration-and-authentication.md) | Packaging, sandboxing, effective configuration, matching, identity validation, authorization, forwarding, GSSAPI, and penalties |32| [connections-and-agents.md](references/connections-and-agents.md) | Rekey, QoS, timeouts, multiplexing, agent sockets, key lifetime, extensions, and forwarding boundaries |33| [file-transfer.md](references/file-transfer.md) | `scp`, `sftp`, destination containment, `internal-sftp`, listings, control masters, and mode preservation |3435## Breaking changes and deprecations3637### Remove legacy cryptography assumptions3839- Treat DSA signatures as unavailable from OpenSSH 10.0.40- Do not assume a server offers finite-field `diffie-hellman-group*` or41 `diffie-hellman-group-exchange-*` methods by default. The corresponding42 client default was not removed at the same time.43- Do not expect compiled-in groups to rescue a present moduli file that has no44 suitable groups.45- Remove experimental XMSS keys before deploying 10.1 or later.46- Upgrade or replace peers that cannot rekey before using 10.3 or later.4748### Install the authentication executable4950OpenSSH 10.0 moves per-connection user authentication from `sshd-session` to51`sshd-auth`.5253- Include `sshd-auth` in portable packages, images, custom install manifests,54 executable allowlists, and integrity policies.55- Expect authentication-phase log messages to be attributed to `sshd-auth`.56- Diagnose a missing `sshd-auth` as a packaging defect rather than an57 authentication-policy failure.5859### Make Linux sandbox support explicit6061On OpenSSH 10.4 Linux builds that use the seccomp sandbox, failure to enable62seccomp or `NO_NEW_PRIVS` prevents `sshd` from continuing.6364- Confirm both facilities work in the deployed runtime.65- Disable the sandbox at configure time if the platform cannot provide them.66- Do not depend on the former log-and-continue behavior.6768### Enforce rekey interoperability6970OpenSSH 10.4 disconnects a peer that sends a non-key-exchange message during a71post-authentication rekey.7273- Fix peers that violate RFC 4253 section 7.1 instead of suppressing the74 disconnect.75- Upgrade clients to receive the fix for a use-after-free triggered when a76 server changes its host key during rekey.77- Treat peers that cannot rekey as incompatible with OpenSSH 10.3 and later.7879### Upgrade agents used through forwarding8081Upgrade forwarded agents to OpenSSH 10.5. Earlier agents could refuse82`session-bind@openssh.com` while locked, allowing a remote user of the83forwarded agent to perform operations that should have remained local-only.84Prioritize agents that can add PKCS#11 tokens or hold destination-restricted85keys.8687### Upgrade concurrent multiplexing clients8889OpenSSH 10.5 fixes a potential realloc use-after-free when automation adds a90remote forwarding through the local multiplexing socket while another91remote-forward open request is pending. Upgrade clients that mutate remote92forwards concurrently over a shared control connection.9394### Upgrade for transfer containment9596- Upgrade clients that download from untrusted servers. `sftp host:/path .`97 now prevents the server from selecting an unexpected local destination.98- Upgrade remote-to-remote `scp` clients so a malicious server cannot write99 into the parent of the intended target directory.100- Audit `internal-sftp` invocations with ten or more arguments. Older releases101 discard the tenth and later arguments and can silently lose a security102 option.103104### Avoid the `ControlPersist` terminal regression105106Do not leave interactive users on OpenSSH 10.1 when `ControlPersist` is active.107OpenSSH 10.2 fixes the regression that could leave terminal sessions unusable.108109## High-use cryptography and key changes110111### Account for new negotiation defaults112113- Expect `mlkem768x25519-sha256` to be the default key exchange from 10.0.114- Expect cipher preference to be ChaCha20/Poly1305, AES-GCM 128/256, then115 AES-CTR 128/192/256.116- From 10.1, expect a default-on warning when negotiation selects a117 non-post-quantum key exchange; configure it with `WarnWeakCrypto`.118- Plan to remove dependencies on SHA1 SSHFP records. The client warns that they119 will eventually be ignored, and `ssh-keygen -r` emits only SHA256 records.120121### Opt in to composite signatures122123OpenSSH 10.4 supports an experimental ML-DSA 44 and Ed25519 composite key type.124It remains disabled by default.125126```sh127ssh-keygen -t mldsa44-ed25519128```129130Add the type explicitly to applicable lists such as `HostKeyAlgorithms` and131`PubkeyAcceptedAlgorithms`; generating a key does not enable negotiation.132133### Keep algorithm and key policy exact134135- Expect invalid cipher and MAC lists to fail while configuration is processed136 instead of later at runtime.137- On 10.3 or later, an ECDSA name in `PubkeyAcceptedAlgorithms` or138 `HostbasedAcceptedAlgorithms` admits only that exact ECDSA algorithm.139- Read [cryptography-and-keys.md](references/cryptography-and-keys.md) before140 changing certificate principals, revocation files, resident-key downloads,141 or PKCS#8 workflows.142143## High-use configuration and authentication changes144145### Match new connection properties146147Use `Match version` in client or server configuration. Client configuration can148also match `sessiontype` and `command`; session types are `shell`, `exec`,149`subsystem`, and `none`.150151```sshconfig152Match version OpenSSH_10.*153 SetEnv GENERATION=10154```155156Use `Match tagged ""` or `Match command ""` when the empty value must match157explicitly.158159### Refuse destinations from configuration160161Use `RefuseConnection` inside an active client `Host` or `Match` block to abort162configuration processing with a useful error.163164```sshconfig165Match host old.example166 RefuseConnection "old.example is retired; use new.example"167```168169### Apply expansion and authorization globs deliberately170171- Client `SetEnv` and `User` values expand percent tokens and environment172 variables, but `User` excludes the self-referential `%r` and `%C` tokens.173- Server `AuthorizedKeysFile` and `AuthorizedPrincipalsFile` accept `glob(3)`174 patterns.175176```sshconfig177AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/*178```179180### Re-check forwarding and GSSAPI policy181182- On 10.4, `DisableForwarding=yes` overrides `PermitTunnel=yes`. On older183 servers, set `PermitTunnel=no` explicitly when tunnels must be prohibited.184- Do not depend on `GSSAPIStrictAcceptorCheck` for a server joined to Windows185 Active Directory; it is ineffective there.186- Upgrade GSSAPI-enabled servers for the pre-authentication denial-of-service187 fix and restored minimum authentication delays.188- Use `PerSourcePenalties`, not `MaxAuthTries`, to mitigate the older GSSAPI189 denial-of-service path.190191## High-use agent and connection changes192193### Handle the agent socket migration194195From 10.1, local and forwarded agent sockets use hostname-hashed paths under196`~/.ssh/agent` instead of `/tmp`.197198- Use `ssh-agent -T` only when the legacy `/tmp` layout is required.199- Use `-U` to suppress stale-socket cleanup, `-u` to perform cleanup only, and200 `-uu` to ignore the hostname during cleanup.201- Remove tooling assumptions that agent sockets always live under `/tmp`.202203### Control key lifetime and agent operations204205- Send `SIGUSR1` to a 10.0-or-later agent to clear all keys.206- Use systemd-style socket activation only when `LISTEN_PID` and `LISTEN_FDS`207 are set and `ssh-agent` runs with `-d` or `-D` without an explicit path.208- Expect certificates loaded from 10.1 onward to be removed five minutes after209 their certificate expiry. Pass `ssh-add -N` to disable that lifetime.210- Use `ssh-add -Q` on 10.3 or later to query supported agent extensions.211212### Re-test transport behavior213214- Interactive-only traffic defaults to EF; non-interactive traffic uses the215 operating-system default, and selection changes as channel types change.216- Remove legacy `lowdelay`, `reliability`, and `throughput` values because they217 are ignored.218- On 10.3 servers, expect first-match-wins `IPQoS` precedence and support for219 the VA codepoint.220- Expect `UnusedConnectionTimeout` to begin only after the final channel closes221 on 10.3 or later.222223## High-use file-transfer changes224225- Expect `scp` and `sftp` to invoke `ssh` with `ControlMaster no`. They reuse an226 existing master but do not create one implicitly.227- Expect `sftp ls -ln` on 10.4 to print numeric user and group IDs; remove228 workarounds for the earlier name output.229- For root downloads using legacy `scp -O`, pass `-p` only when preserving230 setuid or setgid bits is intentional. From 10.3, those bits are otherwise231 cleared.232233## Validation checklist234235- Confirm packages and images install and can execute `sshd-auth`.236- Exercise seccomp and `NO_NEW_PRIVS` initialization in the deployment runtime.237- Validate algorithm lists and exact ECDSA allowlists before rollout.238- Exercise post-authentication rekey against every non-OpenSSH peer.239- Make `sshd -G` consumers accept mixed-case directive names.240- Audit long `internal-sftp` commands and transfers from untrusted servers.241- Test agent discovery, cleanup, certificate expiry, locking, and forwarding.242- Reproduce concurrent remote-forward changes over multiplexed connections.243- Review GSSAPI, forwarding, principal, and per-source penalty policy in the244 detailed references.