NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3492 most downloaded on crates.io
A client and server SSH library.
Latest stable
0.65.1
Last release 19 days ago
03 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 55 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
5 years old
134 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Agent lock status is now rechecked after the confirmation await again.
Agent lock status is now rechecked after the confirmation await again.
kex_done called before host-key verificationclient::Handler::kex_done is now only called after server host key verification succeeds
load_public_key now keeps the comment from an OpenSSH public key file, so key.comment() returns it and to_openssh() round-trips. Fixes #713.add_smartcard_key, lock, unlock, remove_identity, remove_smartcard_key and extension now return the agent's failure response as an error. Before, they always returned Ok(()).untrusted crate it pulled in.Full Changelog: https://github.com/Eugeny/russh/compare/v0.65.0...v0.65.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →
d507707: feat(server): expose the publickey algorithms to Handler (#785) (@Eric-D) #785
Handler::auth_publickey_offered now takes a server::PublicKeyOffer and Handler::auth_publickey takes a server::VerifiedPublicKey instead of &PublicKey. Read the key from the public_key field. The new algorithm field makes accessible the signature algorithm used by the client, allowing the server to react to itasync-trait dependency and crate feature (#786) (@FalkWoldmann) #786Agent::confirmAgent::confirm was defunct and never got called by the agent serverAgentSessionBinding. You need it to send session-bind@openssh.com for OpenSSH destination-constrained agent keys.SSH_AGENT_RSA_SHA2_* flags when signing with RSA keys (#796) (@mdevolde) #796Full Changelog: https://github.com/Eugeny/russh/compare/v0.64.1...v0.65.0
A local actor or a connected remote server (that the user forwards an agent connection to) can trigger an unlimited memory allocation in a russh-based
A local actor or a connected remote server (that the user forwards an agent connection to) can trigger an unlimited memory allocation in a russh-based SSH agent via a crafted message.
5d9d2b8: drop the legacy ed25519 key parser
legacy-ed25519-pkcs8-parser feature. Legacy keys were written in non-compliant format by russh pre-v0.43. From now on, parsing those keys will return a hard error.Russh server side did not verify that the client signatures were made using the negotiated algorithm. While no bypass is possible through this bug, this allowed a client to e.g. silently downgrade its own signature from rsa-sha2-512 to rsa-sha1
efa9a03: Add support hostkeys-prove-00@openssh.com support (#767) (@inureyes) #767
client::Handle::hostkeys_prove to ask the server to prove ownership of the host keys it announced via hostkeys-00@openssh.com.a0ded76: Support sending custom global requests from the client (#759) (@ChrisJr404) #759
client::Handle::send_global_request(name, data, want_reply)want_reply = false on server-side global requestsFull Changelog: https://github.com/Eugeny/russh/compare/v0.63.3...v0.64.0
c13b259: enforce inactivity timeout even during stalled writes (Eugene)
A malicious Pageant agent could cause an out-of-bounds read / oversized allocation in the pageant library user.
pageantA malicious Pageant agent could cause an out-of-bounds read / oversized allocation in the pageant library user.
An authenticated client could trigger unbounded memory allocation during rekey phase
Depending on what the handler does this can lead to a vulnerability.
A mirror of GHSA-m65r-rprj-r5rg for the client side - Handler per-channel callbacks are called even when the server supplies an invalid (never opened) channel ID. Depending on what the handler does this can lead to a vulnerability.
Two peers disagreeing on supported MACs can end up negotiating none MAC for a cipher that requires one, which leads to the session task panicking.
09f6582: Support host certificates on the client side (#752) (@biao29) #752
09f6582: Support host certificates on the client side (#752) (@biao29) #752
Handler::check_server_key to take a new PublicKeyOrCertificate enum instead of &PublicKeyd7601ae: Support host certificates on the server side (#641) (Georg von Zengen) #641
Config::certificates that functions similarly to Config::keysFull Changelog: https://github.com/Eugeny/russh/compare/v0.62.7...v0.63.0
09f6582: Support host certificates on the client side (#752) (@biao29) #752
client: support gssapi-with-mic auth (#738) #738 (ayamir)
Config::max_auth_attempts was not being properly enforced by russh server implementation.
max_auth_attempts was not enforced - f8fd0b1Config::max_auth_attempts was not being properly enforced by russh server implementation.
Russh server did not validate channel IDs passed by a client, so if a client constructed a channel message with an invalid ID, the server-side Handler
Handler channel callbacks called for non-existing channel - 7c5659fRussh server did not validate channel IDs passed by a client, so if a client constructed a channel message with an invalid ID, the server-side Handler callback would still get called with that non-existing ID. The consequence of this depend on the specific user implementation.
Full Changelog: https://github.com/Eugeny/russh/compare/v0.62.4...v0.62.5
Three independent bugs have allowed a client to trigger a panic in the session handler task, thereby crashing their own session.
Three independent bugs have allowed a client to trigger a panic in the session handler task, thereby crashing their own session.
2e3f1cc: Update more RustCrypto dependencies to stabilized versions (#735) (kpcyrd) [#735]
6da3f4a: fixed #733 - incorrect first kex guess handling (Eugene)
6fc20b2: Reply with CHANNEL_CLOSE in server handler per RFC 4254 (#675) (Corey Leavitt) #675
This changes the signature of the Handler::channel_open_* functions to allow you to make the channel accept/reject decision outside of the main event
This changes the signature of the Handler::channel_open_* functions to allow you to make the channel accept/reject decision outside of the main event loop. Instead of immediately returning a bool, they take an additional reply: ChannelOpenHandle argument, which you can move into another async task to confirm or reject the channel later. After the handler function returns, the event loop is immediately unblocked.
This also lets you specify the protocol-level rejection reason.
Migrating your existing code:
async fn channel_open_session(
&mut self,
channel: Channel<Msg>,
+ reply: server::ChannelOpenHandle,
session: &mut Session,
- ) -> Result<bool, Self::Error> {
+ ) -> Result<(), Self::Error> {
if (...) {
- Ok(false)
+ reply.reject(ChannelOpenFailure::AdministrativelyProhibited).await;
} else {
- Ok(true)
+ reply.accept().await;
}
+ Ok(())
}
Full Changelog: https://github.com/Eugeny/russh/compare/v0.61.2...v0.62.0
f1a0f18: fixed #716 - ensure dynamic AgentClient refs are generally Send (#717) (Eugene) #717
When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the
When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the attacker to hit the OOM limit and either get the server process killed by the OS, or, prior to russh@0.58.0, aborted. A similar issue existed in the AgentClient as well, which could be triggered by a malformed SSH agent response.
32fd46f: Reduce russh write-path copies with direct Bytes sends (#695) (Mika Cohen) #695
32fd46f: Reduce russh write-path copies with direct Bytes sends (#695) (Mika Cohen) #695
Channel::data_bytesChannel::extended_data_bytesChannelWriteHalf::data_bytesChannelWriteHalf::extended_data_bytesdeps: migrate to stable versions pkcs5 / pkcs8 / ed25519 and loosen prerelease pins (extends #697) (#702) #702 (escapecode)
72b250a: migrate to upstream ssh-key crate and update RustCrypto crates (#709) (Eugene) #709
Part of the hardening efforts by @mjc
russh server implementation would not correctly reset its internal state (allowed methods and "partial success" state), which could lead to incorrect responses to the client.
keyboard-interactive authentication request, the prompt counter was used to directly allocate memory without verifying it, which can lead to denial of service.russh server did not enfore the SSH protocol header validation strictly enough, allowing a client to hold the connection open indefinitely, wasting resources.When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the
When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the attacker to hit the OOM limit and either get the server process killed by the OS, or, prior to russh@0.58.0, aborted. A similar issue existed in the AgentClient as well, which could be triggered by a malformed SSH agent response.
negotiation: exclude SHA-1 MACs from Preferred::DEFAULT (#690) #690 (Derek Zar—Codebridge)
This DoS vulnerability allowed an unauthenticated user to trigger an out-of-memory condition in a russh based server if keyboard-interactive authentic…
This DoS vulnerability allowed an unauthenticated user to trigger an out-of-memory condition in a russh based server if keyboard-interactive authentication is allowed. A malicious authentication packet could trigger a multi-GB memory allocation likely leading to the process getting killed by the OOM killer.
dad8de6: use rand 0.10 (#673) (Joe Grund) #673
rand 0.10 (#673) (Joe Grund) #673084dbcf: Replace Deprecated Function Calls to criterion::black_box() (#683) (Roger Knecht) #683
Nothing published for this version
eliminate mlock/munlock overhead for non-secret buffers (~21% throughput improvement) (#653) #653 (Mika Cohen)
eliminate mlock/munlock overhead for non-secret buffers (~21% throughput improvement) (#653) #653 (Mika Cohen)
CryptoVec, reducing the performance overhead. A few public functions that took CryptoVec now take impl Into<Bytes> instead.6f70150: Remove heap allocations from SshId (#656) (kpcyrd) #656
SshId::Standard() now contains a Cow<'static, str> instead of a String.0f51860: Expose HostConfig fields to external consumers (#652) (François Bernier) #652
e75de5a: Add russh/serde feature to enable serde on russh::keys::PublicKey (#655) (kpcyrd) #655
replace memset with zeroize in resize() method (#634) #634 (Eric Rodrigues Pires)
bump thiserror to latest version (#651) #651 (Roger Knecht)
b7ce487: Remove Home Crate Dependency (#667) (Roger Knecht) #667
bebe8c0: fixed #658 - make Handle::tcpip_forward and Handle::streamlocal_forward take &self (Eugene)
prevent deadlock when using make_writer for large transfers (#630) #630 (wyebin)
fdf2925: fixed #625 - rand crate breakage (#628) (Eugene) #628
f1e1e1a: Add server side ping (#610) (Mark Bundschuh) #610
russh_config::parse_ssh_config. (#609) (tayu0110) #609kex: add shared secret retrieval and kex_done callback (#604) #604 (stevenparkerco3)
kex_done callback (#604) #604 (stevenparkerco3)140e482: Add ML-KEM post-quantum hybrid key exchange support (#585) (Kenny Root)
6878bf1: A send_ping method for measuring latency (#576) (Môshe van der Sterre) #576
ssh_config more strictly (#570) #570 (Philippe Laflamme)## Fixes - 1ed8ca7: pageant fixes
Nothing published for this version
98b7e91: fixed #558 - zlib compression fails after key renegotiation
0eb5e40: fixed CVE-2025-54804 - missing overflow check in channel window adjust
russh server/client via a checked integer overflow75459ca: Graceful server shutdown
run_on_socket now returns RunningServer instead of an opaque Future.RunningServer.handle() to obtain an asynchronous handle.RunningServerHandle.shutdown() to request a graceful server shutdown which will send MSG_DISCONNECT to all clients and wait for the sessions to close.Config Clone (#544) (Philippe Laflamme)rsa (#550) (Philippe Laflamme)Config.nodelay option for client (#551) (Tom) #551Stream to connect to multiple addresses (#545) (Philippe Laflamme)c41d4f6: Use aws-lc-rs/ring implementation for AEAD ciphers (#535) (Eric Rodrigues Pires) #535
aws-lc-rs/ring implementation for AEAD ciphers (#535) (Eric Rodrigues Pires) #535This improves AES-GCM encryption/decryption performance by 10x and ChaCha20-Poly1305 by at least 2x on commonly used targets.
aws-lc-rs is the default implementation, but you can opt to use ring instead by enabling the ring crate feature. On WASM, you will have to use russh with default-features = false, features = ["ring"] as the default features cannot be controlled per target, and aws-lc-rs does not support WASM.
accept() returns an Error (#518) (Pascal Grange) #518c41d4f6: Use aws-lc-rs/ring implementation for AEAD ciphers (#535) (Eric Rodrigues Pires) #535
aws-lc-rs/ring implementation for AEAD ciphers (#535) (Eric Rodrigues Pires) #535This improves AES-GCM encryption/decryption performance by 10x and ChaCha20-Poly1305 by at least 2x on commonly used targets.
aws-lc-rs is the default implementation, but you can opt to use ring instead by enabling the ring crate feature. On WASM, you will have to use russh with default-features = false, features = ["ring"] as the default features cannot be controlled per target, and aws-lc-rs does not support WASM.
accept() returns an Error (#518) (Pascal Grange) #5185e91396: fixed #515 - unexpected pre-kex message causing panic #516
make ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)
ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)ChannelReadHalf::make_reader[_ext], #498 (#502) #502 (Mingwei Samuel)Handle::send_keepalive (#511) (Uli Schlachter) #511client::Handle::debug (#510) (Pascal Grange) #510make ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)
ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)ChannelReadHalf::make_reader[_ext], #498 (#502) #502 (Mingwei Samuel)Handle::send_keepalive (#511) (Uli Schlachter) #511client::Handle::debug (#510) (Pascal Grange) #51071cd4ab: fixed #468 - allow RSA keys below 2048-bit length
russh has previously disallowed <2048-bit RSA keys - whether as private or as server host keys, both as server and client due to a security check in the ssh-key crate.
This behaviour has now been changed to allow these keys, and the decision to accept or reject them now lies on the library consumer. To recreate the old behaviour within your Handler, add the following check to your check_server_key implementation. You'll need to import the rsa crate.
async fn check_server_key(
&mut self,
server_public_key: &PublicKey,
) -> Result<bool, Self::Error> {
use rsa::traits::PublicKeyParts;
if let Some(ssh_pk) = server_public_key.key_data().rsa() {
let rsa_pk: rsa::RsaPublicKey = ssh_pk.try_into()?;
if rsa_pk.size() < 2048 {
return Ok(false);
}
}
...
}
partial_success support (#478) #478best_supported_rsa_hash method. Previously there was a race condition between calling best_supported_rsa_hash and the server sending the EXT_INFO message. Now russh will wait for up to one second to receive EXT_INFO when you call best_supported_rsa_hash.Channel::split() to allow splitting a channel into a read half and a write half (#482) (Uli Schlachter) #482libc dependency with nix (#483) #483 (iHsin)Nothing published for this version
db5e5ba: wait for extension info from the server in the best_supported_rsa_hash method. Previously there was a race condition between calling best_sup
db5e5ba: wait for extension info from the server in the best_supported_rsa_hash method. Previously there was a race condition between calling best_supported_rsa_hash and the server sending the EXT_INFO message. Now russh will wait for up to one second to receive EXT_INFO when you call best_supported_rsa_hash.
92362fc: Introduce Channel::split() to allow splitting a channel into a read half and a write half (#482) (Uli Schlachter) #482
32667df: Added support for additional DH groups (#486) (Jacob Van Brunt) #486
0c722b8: partial_success support (#478) #478
71cd4ab: fixed #468 - allow RSA keys below 2048-bit length
russh has previously disallowed <2048-bit RSA keys - whether as private or as server host keys, both as server and client due to a security check in the ssh-key crate.
This behaviour has now been changed to allow these keys, and the decision to accept or reject them now lies on the library consumer. To recreate the old behaviour within your Handler, add the following check to your check_server_key implementation. You'll need to import the rsa crate.
async fn check_server_key(
&mut self,
server_public_key: &PublicKey,
) -> Result<bool, Self::Error> {
use rsa::traits::PublicKeyParts;
if let Some(ssh_pk) = server_public_key.key_data().rsa() {
let rsa_pk: rsa::RsaPublicKey = ssh_pk.try_into()?;
if rsa_pk.size() < 2048 {
return Ok(false);
}
}
...
}
83aacd1: re-fixed #470 - correctly ignore hash_alg argument when signing with non-RSA keys via agent
b5e244b: populate comments for agent identities (#466) (Chris) #466
e574068: fixed #460 - do not panic on mlock failures (#464) (Eugene) #464
russh-cryptovec@0.50.2Reverted a change from 0.50.0 that made cryptovec panic when the OS fails to mlock() the memory.
Instead, russh-cryptovec will log a one-time log warning about this.
A common cause for these errors is running on Linux under a low RLIMIT_MEMLOCK limit
Nothing published for this version
23cc724: (#450) - the russh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise
russh_keys merged into russhrussh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise remove the russh_keys dependency and replace all use russh_keys imports with use russh::keys.client::Handler, server::Handler and other traits are now native Rust async traits. In most cases, you can simply remove the #[async_trait] macro from your trait impl. Alternatively, you can enable the async_trait feature, which will turn the traits into #[async_trait]s again. Note that the old async_trait support will be removed soon.Russh client now supports the server-sig-algs OpenSSH extension and can automatically select the strongest hash for RSA keys.
You can use russh::client::Handle::best_supported_rsa_hash() to choose the hash.
PrivateKeyWithHashAlg::new is now infallible and will ignore hash_alg for non-RSA keys, so you don't have to build separate logic just for RSA keys:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.unwrap_or(...), // some fallback Option<HashAlg>
),
).await?;
If you just want to fall back to SHA1 / ssh-rsa in case the server does not support server-sig-algs:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.flatten(),
),
).await?;
Config::channel_buffer_size to control how many channel messages can be buffered before backpressure propagates over the network. Previously russh would simply buffer unread channel messages infinitely, eventually causing an out-of-RAM situation, and now it will block the connection until you consume them. Even if the server does not write data to the channel (e.g. it's a write-only channel for you as a client), it is still writing flow control messages, which you must consume.So, any time you open a channel, make sure you have a loop somewhere that is either polling .wait() or reads from the AsyncRead side of its ChannelStream.
ssh-key traitsrussh has migrated to its own fork of the ssh-key crate, removed bundled workarounds - if you were relying on traits directly imported from ssh_key, you might need to import them from russh::keys::ssh_key instead.diffie-hellman-group-exchange-sha256 KEX is now on the default kex list. To take advantage of dynamic DH groups, pre-generate some safe primes and implement dynamic group lookup in the server::Handler::lookup_dh_gex_group method - see this method's docs for more info.authentication_banner method to server::Handler (#415) (Eric Rodrigues Pires) #415 - you can now send a dynamic SSH banner to clients.MSRV for the russh crate is now 1.75
des dependency (#424) (Eric Seppanen) #424Nothing published for this version
72847a7 / d4d3605: support automatic RSA key hash detection using server-sig-algs extension (#452 / #453)
Russh client now supports the server-sig-algs OpenSSH extension and can automatically select the strongest hash for RSA keys.
You can use russh::client::Handle::best_supported_rsa_hash() to choose the hash.
PrivateKeyWithHashAlg::new is now infallible and will ignore hash_alg for non-RSA keys, so you don't have to build separate logic just for RSA keys:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.unwrap_or(...), // some fallback Option<HashAlg>
),
).await?;
If you just want to fall back to SHA1 / ssh-rsa in case the server does not support server-sig-algs:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.flatten(),
),
).await?;
902010f: Allow setting hash algorithm to use for signing requests of SSH agent (#449) (Wiktor Kwapisiewicz) #449
c33d692: exported missing MethodKind type (Eugene)
23cc724: merge russh-keys into russh (#450) #450
The russh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise remove the russh_keys dependency and replace all use russh_keys imports with use russh::keys.
77f53ed: support for parsing X9.62 EC private keys
9548f04: added missing AuthResult export (Eugene)
One column per quarter.