WEBINARLive webinar: Terraform in Buddy, Oct 21st.Terraform: plan, approve, apply with state in Buddy. Live on October 21st.Save your seat

bdy sandbox ssh

View as Markdown
$bdy sandbox ssh|connect [options] <identifier> [args...]

Open an interactive SSH session to a sandbox Authenticates with the SSH key you added to your Buddy account - the session always runs as the buddy user, whatever login is sent Arguments for ssh itself, or a command to run instead of a shell, go after -- Required scopes: SANDBOX_READ

ARGUMENTS
identifier
Sandbox identifier (required)
args
Arguments passed to ssh and the remote command to run, e.g. -- -L 8080:localhost:8080 (required)
OPTIONS
--context <name>
Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation.
--examples
Show only examples; with this flag --format accepts text, json or jsonl
--verbose
Show REST API requests, responses, timing and retries on stderr
-w, --workspace <domain>
Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE
-p, --project <name>
Project name. Can be set via variable: BUDDY_PROJECT
--scope <scope>
Force scope (WORKSPACE, PROJECT, ENVIRONMENT). By default calculated by provided options and environmental variables (--project,
--environment
BUDDY_PROJECT, linked project)
-e, --environment <identifier>
Environment identifier
-i, --identity <path>
Private key file used for authentication (ssh
--print
Print the ssh command instead of running it
-h, --help
display help for command

Documentation for bdy v1.25.20

Last modified on Oct 14, 2026

Examples

Open a shell in the sandbox
bdy sb ssh sandbox-identifier$
Run a single command and exit
bdy sb ssh sandbox-identifier -- ls -la$
Forward a sandbox port to localhost
bdy sb ssh sandbox-identifier -- -L 8080:localhost:8080$
Authenticate with a specific private key
bdy sb ssh sandbox-identifier -i ~/.ssh/id_ed25519$
Print the ssh command instead of running it
bdy sb ssh sandbox-identifier --print$