A SSH client and server implementation. This is a fork of mkj/sunset, maintained under navigato-rs for FileMan and Starcom.
-
sunset(this toplevel) is the core SSH implementation. It provides a non-async API, runs withno_stdand no alloc. -
sunset-async- async SSH client and server library, alsono_stdno-alloc. This is async-executor agnostic (using Embassy for mutexes, but works on std too). -
demohas demos with Embassy executor for wifi on a Raspberry Pi Pico W or a Linux tap device onstdrunning locally.At present the Pico W build is around 150kB binary size (plus ~200KB cyw43 wifi firmware), using about 13kB RAM per concurrent SSH session.
-
sunset-stdasyncadds functionality to use Sunset as a normal SSH client or server async library in normal Rust (notno_std). This uses Tokio or async-std.The examples include a Linux commandline SSH client
sunsetc. It works as a day-to-day SSH client.sftpcis a commandline SFTP client usingsunset-sftp. -
sunset-sftpimplements an SFTP server and client. An example of the application side is in demo/sftp/std. The client's core,SftpRunner, performs no IO of its own, the same assunset::Runner;SftpClientis theembedded_io_asyncwrapper over it. Withdefault-features = falsethe async layers are left out and the crate has no async dependencies at all.sunset-sftpis currently under development, treat as alpha status.
Working:
- Client and server
- Shell or command connection
- Password and public key authentication
- ed25519 signatures
- curve25519 key exchange
- chacha20-poly1305, aes256-ctr ciphers
- hmac-sha256 integrity
- rsa (
std-only unless someone writes ano_stdcrate) - ecdsa256
~.client escape sequences- Post quantum hybrid key exchange (mlkem)
- SFTP server and client
- Client
direct-tcpip(local TCP forward, the channel behindssh -L/ssh -J) - Agent-held
sk-ssh-ed25519@openssh.comkeys (signing stays in the agent) - SSH agent protocol encoding and decoding without IO,
sunset::agentbehind theagentfeature. The socket is the caller's, so a Windows named pipe agent is as reachable as a Unix one. - Up to 16 concurrent channels
- Client-initiated channel EOF, so remote commands reading stdin can finish
Desirable:
- sntrup761
- Inbound / remote TCP forwarding (
forwarded-tcpip) - A std server example
- Perhaps aes256-gcm
- Keyboard-interactive and certificates
Sunset uses forbid(unsafe), apart from sunset-async which
requires unsafe for Unix interactions.
Release builds should not panic, instead returning Error::bug().
debug_assert! is used in some places for invariants during testing or
fuzzing.
Some attempts are made to clear sensitive memory after use, but compiler-generated copies will not be cleared.
Originally written by Matt Johnston matt@ucc.asn.au. This fork is developed mostly by LLMs, to serve FileMan and Starcom.
It's built on top of lots of other work, particularly Embassy, the rust-crypto crates, Virtue, smoltcp, and Salty.