> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# devbox ssh

> Open an SSH session or run an SSH command on a Devbox.

Use `devbox ssh` to open an interactive SSH session or run a command on a Devbox. The command activates the selected Devbox before connecting.

## Usage

```bash theme={null}
devbox ssh [name] [-- command...] [flags]
```

If you omit the Devbox name, the CLI prompts you to select one. Arguments after the name, or after `--`, are run as the remote command.

## Open an interactive shell

```bash theme={null}
devbox ssh main
```

## Run a command

```bash theme={null}
devbox ssh main -- npm test
```

## Forward the local SSH agent

```bash theme={null}
devbox ssh -A main
```

## Options

**-T, --disable\_pty** `boolean` (default: false)

Disable pseudo-terminal allocation.

**-t, --force\_pty** `boolean` (default: false)

Force pseudo-terminal allocation when running a command.

**--show\_all** `boolean` (default: false)

Include Devboxes owned by other workspace members when selecting a Devbox.

**-A, --ssh\_agent** `boolean` (default: false)

Forward the local SSH agent to the Devbox.

## Related topics

> [card] [SSH & Sessions](https://namespace.so/docs/devbox/connecting.md#ssh)
>
> Learn about SSH access to Devboxes.

> [card] [Execute commands](https://namespace.so/docs/devbox/exec.md)
>
> Compare interactive SSH with retained executions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.