SSH gives a sandbox a familiar interface without putting an SSH daemon inside the guest. microsandbox speaks SSH on the host side, then forwards shells, remote commands, and SFTP file operations through the sandbox’s command and filesystem channels. Use it when you want existing SSH tools to work with a sandbox, or when you want SDK code to use SSH semantics while still going through microsandbox. There are two ways to connect:Documentation Index
Fetch the complete documentation index at: https://docs.microsandbox.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Native sessions use the built-in microsandbox SSH client. No host
sshbinary, TCP listener, or authorized key is required, which makes it the quickest path for a shell frommsbor SSH semantics from the SDK. - External clients serve the sandbox as an SSH server so standard tools such as
ssh,sftp, andProxyCommandcan connect.
Native sessions
Native sessions keep the SSH protocol boundary but do not expose a listener. microsandbox creates an in-process SSH client/server pair over an in-memory stream, then forwards SSH channels to the sandbox.CLI
--, the remaining tokens become the SSH command string and run through the sandbox shell.
serve or authorize, use --name. Sandbox names are limited to 128 UTF-8 bytes:
SDK
Interactive attach
SDK clients can attach the local terminal to an SSH shell. This requires a real terminal.SFTP
The native SSH client can open SFTP over the same SSH connection.External clients
External client mode exposes a sandbox as an SSH server for tools that already speak SSH. This is the closest match for normal SSH usage: authorize a public key, serve the sandbox, then connect withssh or sftp.
Authorize a key
<MSB_HOME>/ssh/authorized_keys. Existing keys are deduplicated by public-key material.
TCP listener
127.0.0.1:2222.
Binding to
0.0.0.0 exposes the SSH listener beyond the local machine. Keep the default loopback bind unless you intentionally want remote clients to connect.ProxyCommand
msb ssh serve --stdio carries a single SSH connection over stdin/stdout instead of a TCP listener. Point OpenSSH at it with ProxyCommand so any standard SSH tool can reach the sandbox by host alias, with no port to manage.
Add an entry to your ~/.ssh/config:
~/.ssh/config
Host value is the alias you connect to, and devbox is the sandbox name passed to msb ssh serve. No HostName or Port is needed, because OpenSSH runs the ProxyCommand to open the transport instead of dialing a socket.
Once it is in place, the alias works with any OpenSSH-based tool:
devbox.msb host the same way.
SDK server endpoints
The Rust SDK exposes the general form: prepare an SSH server endpoint, then pass each ordered duplex stream toserve(stream).