> ## 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

<ResponseField name="-T, --disable_pty" type="boolean" default="false">
  Disable pseudo-terminal allocation.
</ResponseField>

<ResponseField name="-t, --force_pty" type="boolean" default="false">
  Force pseudo-terminal allocation when running a command.
</ResponseField>

<ResponseField name="--show-all" type="boolean" default="false">
  Include Devboxes owned by other workspace members when selecting a Devbox.
</ResponseField>

<ResponseField name="-A, --ssh_agent" type="boolean" default="false">
  Forward the local SSH agent to the Devbox.
</ResponseField>

## Related topics

<Columns cols={2}>
  <Card title="Remote development" icon="monitor" href="/docs/devbox/remote-development">
    Learn about SSH access to Devboxes.
  </Card>

  <Card title="Execute commands" icon="terminal" href="/docs/devbox/exec">
    Compare interactive SSH with retained executions.
  </Card>
</Columns>
