Skip to main content

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.

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.

Serve a sandbox to SSH clients

The main workflow is to serve a sandbox locally, then connect with standard OpenSSH tools.
msb ssh authorize --file ~/.ssh/id_ed25519.pub
msb ssh serve devbox

ssh -p 2222 root@127.0.0.1
sftp -P 2222 root@127.0.0.1
This is useful for terminal sessions, SFTP transfers, editor integrations, and any tool that already knows how to speak SSH. msb ssh serve binds to 127.0.0.1:2222 by default and requires keys to be authorized explicitly. For clients that prefer a transport bridge instead of a TCP listener, serve over stdio:
Host devbox.msb
  User root
  ProxyCommand msb ssh serve devbox --stdio

Open a native session

For quick interactive access, use the built-in microsandbox SSH client. This does not require the host ssh binary, a TCP listener, or an authorized public key.
msb ssh devbox
msb ssh connect devbox
msb ssh devbox -- uname -a
Use this when you just want a shell or one remote command from the msb CLI.

Use SSH from the SDK

The SDKs expose the same SSH capability from a running sandbox. You can run SSH-style commands, attach interactively, and open SFTP from code.
let ssh = sandbox.ssh().connect().await?;

let output = ssh.exec("uname -a").await?;
let sftp = ssh.sftp().await?;