What is SSH key exchange?

SSH key exchange is the step where an SSH client and server agree on shared secret material and the client checks the server's identity. Post-quantum and hybrid methods now appear in it, and this page explains what each term means for an inventory.

On this page

What SSH key exchange does and where you meet it

SSH key exchange is the step in the SSH transport layer where client and server agree on shared secret material and, through the server host key signature, the client authenticates the server, as defined in RFC 4253. You will most often meet the term as a method name in an sshd_config KexAlgorithms line, in scanner output listing the key exchange methods a server offers, or in a vendor answer to a tender question asking which key agreement algorithms an SSH endpoint supports. Each method name tells you which exchange is in use, so a line such as mlkem768x25519-sha256 or curve25519-sha256 is the place to start when you assess a host.

Key exchange and host key signing are separate parts of the handshake, and reviewers should keep them apart. The key exchange method agrees the session secret, while the server host key, and the signing algorithm negotiated alongside it, proves the server's identity. RFC 4253 says the algorithm list is negotiated during the exchange, with the client's preference order winning among mutually supported options and both sides disconnecting if no compatible set exists. The OpenSSH project page notes that signature keys do not carry the same store-now-decrypt-later risk as key agreement, so a vendor answer about key exchange should not be read as an answer about host keys or certificates.

For planning, check the methods your servers actually negotiate rather than the ones listed in a document. Confirm the OpenSSH version in use against the OpenSSH release notes and PQ page, and review the WarnWeakCrypto setting in ssh_config or sshd_config if your version supports it, since it logs or warns when a classical-only exchange is negotiated. Where a method name in a vendor document is not described in the sources available here, ask the vendor for the RFC or specification it implements and confirm compatibility for the exact versions you run.

Which key exchange method names appear in SSH configuration

This table lists the key exchange method names you will see in SSH configuration files, handshake logs and scanner output, with the document that defines each name. Use it to match a name in a config or scan result to its specification and to see which names are post-quantum or hybrid. The method name is the string that appears in configuration and scanner output, so a name that is missing from an inventory or scan is the first thing to check.

Method nameDefining documentTypeWhat to confirm
diffie-hellman-group1-sha1RFC 4253 (January 2006)Classical, finite-fieldRequired in the original RFC 4253 list. Check whether your sshd still offers it, since OpenSSH 10.0 (2025-04-09) disabled finite-field Diffie-Hellman in sshd by default.
diffie-hellman-group14-sha1RFC 4253 (January 2006)Classical, finite-fieldUses SHA-1 and the 2048-bit Oakley Group 14. Treat it as a classical method that is not post-quantum and flag it in inventories.
ecdh-sha2-nistp256 (pattern ecdh-sha2-<curve>)RFC 5656 (December 2009)Classical, elliptic curveA pattern: the suffix names the curve. Confirm the exact curve string your server accepts, since the pattern covers several curves.
curve25519-sha256RFC 8731 (February 2020)Classical, elliptic curveUses SHA-256. Matches the earlier privately defined curve25519-sha256@libssh.org. Note this is classical and not post-quantum.
curve448-sha512RFC 8731 (February 2020)Classical, elliptic curveUses SHA-512. Confirm whether your SSH stack offers it, since many configurations list only curve25519.
sntrup761x25519-sha512RFC 9941 (Informational, April 2026)Hybrid, post-quantumCombines Streamlined NTRU Prime sntrup761 with X25519. OpenSSH has used it by default since version 9.0 (April 2022), per the OpenSSH project page.
mlkem768x25519-sha256RFC 10042 (Informational, August 2026)Hybrid, post-quantumCombines ML-KEM-768 with X25519. Became the OpenSSH default in version 10.0 (April 2025), per the OpenSSH project page. Confirm it in your server's list.
mlkem768nistp256-sha256RFC 10042 (Informational, August 2026)Hybrid, post-quantumCombines ML-KEM-768 with ECDH on nistp256. Confirm your peers support it before you rely on it in a migration plan.
mlkem1024nistp384-sha384RFC 10042 (Informational, August 2026)Hybrid, post-quantumCombines ML-KEM-1024 with ECDH on nistp384. Its classical component is 48 bytes, per RFC 10042, so check the length handling of your implementation.

Where SSH key exchange shows up in sshd, scanners and tenders

SSH key exchange appears in server configuration, release notes, scanner output and vendor or tender questions. Each place answers a different question, from what a server is set to negotiate to what a vendor says it supports. Reading them together lets a reviewer confirm the method names a server actually offers.

sshd and ssh configuration files

The server and client configuration files list the key exchange methods they will offer or accept, typically through a KexAlgorithms setting. Check which methods are listed and in what order, because the client's preference order decides among mutually supported options. A method that is absent from the list cannot be negotiated, and an empty overlap between client and server causes the connection to fail. Confirm the setting on each host instead of assuming the defaults of a given version.

OpenSSH PQ page

OpenSSH release notes

The OpenSSH release notes record when key exchange defaults change and when new methods or warnings arrive. For example, the notes for 10.0 say finite-field Diffie-Hellman is disabled in sshd by default, and the notes for 10.1 add a client warning for non-post-quantum key agreement. Use them to decide which version you need before a configuration can rely on a given method. Do not infer support from the version number alone without reading the notes for that release.

OpenSSH release notes

Scanner output listing negotiated kex methods

Port scanners and SSH audit tools list the key exchange methods a server offers or negotiates. Read the list as a record of what the server accepted during the handshake, not as proof of which method was used for a given session. Look for the exact method name, such as mlkem768x25519-sha256 or a classical curve-based name, since the names differ in meaning. Record the scanner version and scan date so the result can be compared later.

Vendor documents on supported methods

Vendor product documents state which key exchange methods a product supports and which version or edition they apply to. Check whether the claim covers the server, the client, or both, because the two may differ. Ask whether a method is enabled by default or must be set manually. A statement about one component should not be read as covering the whole product.

Tender and audit questions on kex support

Tenders and audit requests often ask which key exchange methods are supported and whether classical methods remain enabled. Answer with the exact method names, the component and version they apply to, and the configuration that enables them. Ask the vendor to confirm the answer against a live host or a scanner result, not only a datasheet. Keep the evidence with the answer so an auditor can trace the claim.

How the client and server negotiate a key exchange method

Before any key material is exchanged, the client and server run an algorithm negotiation. Each side sends a list of the key exchange methods, host key signing algorithms and other algorithms it supports, in its own order of preference. The client's preference order decides the outcome: the method chosen is the first one on the client's list that the server also supports. If no compatible set of algorithms exists, both sides disconnect, as defined in RFC 4253. When you audit a server, the practical check is therefore what the server advertises, not only what it prefers, because a server that offers only classical methods will negotiate a classical method with any client that also lacks post-quantum support. Confirm the list your servers actually send with a scan or a verbose client connection, and compare it against your policy.

The same step also settles how the server proves its identity. The server host key signs the exchange hash, and the signing algorithm is negotiated during this algorithm exchange, as RFC 4253 section 8 describes. A key exchange can therefore be post-quantum while the host key signature remains classical, or the reverse. Reviewers should check the key exchange method and the host key algorithm separately, since a configuration can strengthen one and leave the other unchanged. Host key types are covered in their own term, but when you read negotiation output, record both values.

RFC 4253 section 7 also allows either side to guess the other's preferred algorithm and send its first key exchange packet early. If the guess matches the algorithm the other side selects, the exchange saves a round trip. If the guess is wrong, that packet is ignored and the negotiation continues normally. For operators, this means a mismatch in guessing does not by itself cause a failure, so logs showing an ignored early packet are not evidence of a broken or downgraded handshake. Use the full negotiated algorithm list, not the presence of a guess, when you judge what a connection used.

Where key exchange sits in the SSH connection sequence

The diagram starts when the client opens a connection and both sides send their supported algorithm lists, with the client's preference order deciding among mutually supported options. The key exchange packets follow, producing shared secret material. The server then signs the exchange hash with its host key, and the client verifies that signature before the session proceeds. If no compatible set of algorithms exists, both sides disconnect. When reviewing a server, confirm which key exchange method was actually negotiated, since the algorithm lists define what is possible but not what was chosen.

Key exchange and host key signature verification within the SSH transport handshake.

Which RFCs and OpenSSH releases have adopted post-quantum key exchange

Post-quantum key exchange in SSH is defined in several documents, and the status of each one differs. Only RFC 10042 and RFC 9941 are IETF standards-track documents in name, and both are Informational. RFC 10042, published by the IETF sshm working group in August 2026, defines the hybrid methods mlkem768nistp256-sha256, mlkem1024nistp384-sha384 and mlkem768x25519-sha256. IANA has registered these method names with OK to Implement set to SHOULD. RFC 9941, published in April 2026, defines sntrup761x25519-sha512. An Informational RFC records a published specification but does not by itself make a method mandatory, so read the status line and the registry entry in each document before citing it in a vendor answer or tender response.

OpenSSH has shipped post-quantum key agreement for longer than these RFCs have existed. According to the OpenSSH project page, version 9.0 (April 2022) enabled sntrup761x25519-sha512 by default, version 9.9 added mlkem768x25519-sha256, and version 10.0 (April 2025) made mlkem768x25519-sha256 the default. Version 10.0 also disabled finite-field (modp) Diffie-Hellman key exchange in sshd by default. Later releases added a client warning for non-post-quantum key agreement in 10.1 and a server-side log entry under WarnWeakCrypto in 10.6, as the release notes describe. Confirm the exact version you run with ssh -V and check the server's sshd_config for any override of the default key exchange list.

For a review, ask which RFC revision and which OpenSSH version each system runs, and whether any host still offers modp Diffie-Hellman methods that the default configuration now removes. Check the OpenSSH release notes and the RFC text yourself for the exact wording and effective dates, and confirm with your vendor how a product built on OpenSSH or another SSH library handles these method names. The sources listed here do not state whether any particular third-party SSH implementation supports these methods.

What to check in an SSH inventory before and during migration

This sequence builds a record of every SSH server and client that negotiates key exchange, identifies which methods each one offers and agrees to, and flags classical-only or weak settings. The output is a list of components with their versions, negotiated methods and warning settings, which tells you what needs upgrading or configuring and what to ask vendors.

  1. List every sshd and ssh client

    Start by listing every place SSH key exchange happens in your environment: servers running sshd, and clients such as the OpenSSH client, scripts, automation tools, build systems and vendor appliances that open SSH connections. Include embedded devices and network gear that may run their own SSH stack. Record the host, the component, the owner and whether it is a server, a client or both. The step is done when every system that negotiates key exchange appears on the list, and the owners have confirmed the list is complete.

  2. Record negotiated key exchange method names

    For each listed system, capture the key exchange method names it actually negotiates, using scanner output or a connection test against a known peer. Method names look like curve25519-sha256, ecdh-sha2-nistp256, diffie-hellman-group14-sha256 or the hybrid names such as mlkem768x25519-sha256. Record the names exactly as they appear, because the exact string is what you will match against vendor documentation and the IANA registry. The step is done when each system has at least one recorded negotiated method, and you have noted the peer it was negotiated against.

  3. Identify versions and whether they predate 9.0

    Record the exact SSH software version for each server and client. The OpenSSH project states that post-quantum key agreement has been enabled by default since version 9.0, so any OpenSSH build older than 9.0 will not offer it by default. Mark each system as predating 9.0 or not, and for non-OpenSSH implementations, record the vendor version string and ask the vendor which key exchange methods it supports. The step is done when every system has a version recorded and the systems that predate 9.0 are flagged for review.

  4. Check for modp Diffie-Hellman and classical-only methods

    Search the negotiated and configured method lists for finite-field Diffie-Hellman groups (names containing modp or diffie-hellman-group) and for other classical-only methods with no post-quantum component. The OpenSSH 10.0 release notes say finite-field key exchange was disabled in sshd by default, so an sshd that still offers these methods may have been configured to re-enable them. Mark each system that offers modp or classical-only methods, and note whether the setting is a default or an explicit override. The step is done when each system is labelled as offering only post-quantum hybrid methods, offering a mix, or offering classical-only methods.

  5. Confirm WarnWeakCrypto behavior for 10.1 and 10.6

    For OpenSSH systems at version 10.1 or later, check the ssh_config setting WarnWeakCrypto, which the release notes say defaults to on, so the client warns when a connection negotiates a non-post-quantum key agreement method. For sshd at version 10.6 or later, check the matching option in sshd_config, which logs when a client uses a key agreement scheme that is not post-quantum. Record the effective value on each system, because a configuration file may override the default. The step is done when every OpenSSH system at 10.1 or later has its WarnWeakCrypto value confirmed, and any system where the warning is disabled is listed with the reason.

  6. Ask vendors about kex method names and defaults

    For every system where the inventory cannot confirm the method list, ask the vendor which key exchange method names its product offers and whether a post-quantum method is enabled by default. Request the exact method identifiers, the version in which each was added, and the default configuration. Ask whether the vendor has published a configuration guide for these methods. Record each answer with its date and the document it came from. The step is done when each vendor has answered in writing, and any question the vendor has not answered is marked as open.

  7. Record the inventory for review

    Consolidate the results into one table with one row per system, listing the host, component, owner, version, whether it predates 9.0, the negotiated and offered method names, whether modp or classical-only methods are present, the WarnWeakCrypto value, and the vendor answer status. Keep the table as the baseline for migration and for re-checking after each upgrade, since negotiated methods can change when configuration or versions change. The step is done when the table is complete, reviewed by the system owners, and stored where the migration team can update it.

Terms that get mixed up with SSH key exchange

SSH key exchange sits next to several names that look similar but do different jobs. Key exchange agrees on shared secret material, host key signing authenticates the server, and hybrid method names bundle components. Knowing where each term applies helps you read configuration, scanner output and vendor claims accurately.

Key exchange versus host key signing

Key exchange produces the shared secret that protects the session, while the server host key signs the exchange hash so the client can authenticate the server (RFC 4253). These are separate negotiated items: a method name such as mlkem768x25519-sha256 tells you nothing about which host key algorithm signs the exchange. When reviewing a configuration or scan, check the key exchange list and the host key algorithm list independently, and do not treat one as evidence for the other.

RFC 4253

Same method under two names

The method curve25519-sha256 is identical to the earlier privately defined curve25519-sha256@libssh.org, according to RFC 8731, which registered the standard name. Scanners and older configurations may still show the @libssh.org form, so an inventory that counts method names literally can report one algorithm twice or miss it. Normalize names before comparing an inventory against a vendor's list of supported methods, and confirm with the vendor how each name appears in its output.

RFC 8731

Hybrid name versus its components

A hybrid method such as mlkem768x25519-sha256 combines a post-quantum KEM with a classical ECDH exchange, and the combined secret is derived from both (RFC 10042). The name therefore does not mean the post-quantum part or the classical part is supported alone. Standalone ML-KEM or X25519 methods, if present, are separate entries with separate behavior, so confirm which exact method a server negotiates rather than assuming the components are present independently.

RFC 10042

Vendor claims without a version

A vendor saying it supports post-quantum SSH key exchange does not tell you which method, which software version, or whether the feature is enabled by default. OpenSSH, for example, enabled post-quantum key agreement by default from version 9.0 with sntrup761x25519-sha512, added mlkem768x25519-sha256 in 9.9, and made it the default in 10.0 (OpenSSH PQ page). Ask for the exact method names, the version tested, and the default configuration before accepting the claim.

OpenSSH PQ page

Warnings are not enforcement

OpenSSH 10.1 added a client warning when a connection negotiates a non-post-quantum key agreement method, controlled by WarnWeakCrypto, which defaults to on (OpenSSH release notes). A warning shows the connection is classical but does not block it, so it is not evidence that weaker methods are disabled. Check whether a server rejects classical-only methods or merely logs them before counting the server as migrated.

OpenSSH release notes

Questions people ask about SSH key exchange

What does SSH key exchange stand for?

SSH key exchange does not stand for an acronym. It is the name for the step in the SSH transport layer where a client and server agree on shared secret material. Through the server host key signature, the client also authenticates the server. The step is defined in RFC 4253, a Proposed Standard published in January 2006. Each side sends a list of the key exchange methods it supports, the client's preference order wins among mutually supported options, and if no compatible set exists both sides disconnect. When reading a configuration or scanner output, the method name (for example, mlkem768x25519-sha256) identifies which algorithm performed the exchange. Confirm the method names your version supports in its documentation.

Is SSH key exchange the same as the SSH host key?

No. The key exchange produces the shared secret that encrypts the session. The host key is a long-term server key that signs the exchange hash so the client can confirm it is talking to the right server. RFC 4253 says the server host key signs the exchange hash, and the signing algorithm is negotiated during the algorithm exchange. The two are separate negotiations, so changing the key exchange method does not by itself change the host key, and changing the host key does not change the key exchange. Post-quantum work usually addresses them on different timelines, with key exchange handled first because of the store-now-decrypt-later risk.

Are post-quantum SSH key exchange methods standardized?

Yes, as Informational RFCs. RFC 10042, published in August 2026 by the IETF sshm working group, defines the hybrid methods mlkem768nistp256-sha256, mlkem1024nistp384-sha384 and mlkem768x25519-sha256. These combine ML-KEM with ECDH, and the combined secret is derived from both components, so the exchange stays protected if either component holds. RFC 9941, published in April 2026, defines sntrup761x25519-sha512. Informational status means the documents give guidance and are not an IETF Standards Track specification. IANA registered the RFC 10042 names with the OK to Implement value SHOULD. Check which methods your implementation lists and whether it follows these RFCs before relying on them in a vendor answer.

Does OpenSSH enable post-quantum key exchange by default?

Yes, from a recent version onward. The OpenSSH project page states that OpenSSH has enabled post-quantum key agreement by default since version 9.0 (April 2022), first with sntrup761x25519-sha512. Version 9.9 added mlkem768x25519-sha256, which became the default in version 10.0 (April 2025). Version 10.0 also disabled finite-field (modp) Diffie-Hellman key exchange in sshd by default. Defaults can be overridden in configuration, and distributions may package their own builds, so check the version and configuration actually running on each host with the server's effective settings rather than assuming the upstream default applies.

What does WarnWeakCrypto log in OpenSSH?

WarnWeakCrypto is an option that makes OpenSSH log when a connection uses a key agreement method that is not post-quantum safe. OpenSSH 10.1, released 2025-10-06, added a client warning controlled by the ssh_config option WarnWeakCrypto, which defaults to on. The OpenSSH 10.6 release notes, dated 2026-10-06, say sshd will log in the same way under WarnWeakCrypto, now available in sshd_config. The log is a signal that a classical-only exchange was negotiated. It does not show whether the rest of the session is protected, and it does not cover host key signatures. Review the server's log destination and confirm the option's behavior in the version you run.

What should I ask a vendor about SSH key exchange methods?

Ask which key exchange methods are offered and in what preference order, and whether the post-quantum methods are enabled by default or only when configured. Ask which RFCs or upstream versions the implementation follows, and whether classical-only methods such as diffie-hellman-group14-sha1 or curve25519-sha256 remain available as fallbacks. Ask how the product handles the length checks and disconnect behavior that RFC 10042 requires, and whether large key exchange messages are supported. Ask whether host key signatures are addressed separately. Ask for the exact version and configuration used in the evaluated build. Vendor answers should name methods and versions rather than general claims.

How DeployOpen works on this

DeployOpen helps teams that run self-hosted SSH services review which key exchange methods their servers and clients offer, and plan changes inside their own infrastructure. Work is scoped in writing, configured and tested in the client's environment, documented, and then handed over with support available as a retainer.

How we scope

  • We list the sshd and ssh versions in use and which key exchange methods each one offers and accepts.
  • We identify clients and automation that pin older methods, such as diffie-hellman-group14-sha1, before any change is made.
  • Engagements are fixed-scope, and the written scope states which hosts, versions and methods are covered.

How we build

  • We set the KexAlgorithms preference order in sshd_config and ssh_config on the systems in scope, with rollback steps written down.
  • We test negotiation from each client type and check that the server selects the method the scope intends.
  • We review sshd logs for WarnWeakCrypto messages on OpenSSH 10.6 and later, where that option is available, to find remaining classical connections.

How we hand over

  • We document the final key exchange configuration, the negotiation test results and the list of exceptions with owners.
  • We explain how to confirm the negotiated method on a live connection so your team can repeat the check.
  • We confirm compatibility for the exact OpenSSH versions you run, since the sources do not establish interoperability across all builds.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • We can re-run negotiation tests when OpenSSH or client versions change in your environment.
  • Host key and signature planning is handled as a separate scope, since key exchange and signatures carry different risks.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.