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

# nsc scratch ssh

Create a temporary scratch instance and SSH to it. The instance is destroyed on exit.

`scratch ssh` combines instance creation and SSH access into a single step:
it creates a new ephemeral instance, waits for it to become ready, and then
opens an SSH session into it. As soon as you disconnect, the instance is
destroyed — there's nothing left to clean up afterward.

This is a convenient one-shot workflow for quick experiments where you just
want a shell on a fresh machine, without separately running
[`nsc create`](https://namespace.so/docs/reference/cli/create) and [`nsc ssh`](https://namespace.so/docs/reference/cli/ssh).

## Usage

```bash theme={null}
nsc scratch ssh [--machine_type [os/arch:]<cpu>x<mem>] \
    [--selectors <name1=value1,name2=value2>] \
    [--wait_timeout <duration>] \
    [-T] [-t] [-A]
```

### Example

```bash theme={null}
nsc scratch ssh
```

```text nocopy Output theme={null}
85a32emcg99ii:~#
```

## Options

### --machine\_type \[os/arch:]\<cpu>x\<mem>

Specify the machine shape for the temporary instance. Follows the same
`[os/arch:]<cpu>x<mem>` format as [`nsc create`](https://namespace.so/docs/reference/cli/create)'s `--machine_type` flag — for example,
`--machine_type linux/arm64:2x8` starts a 2 vCPU, 8 GiB RAM ARM64 machine
running Linux.

### --selectors

Select the platform or base image for the temporary instance based on
specific properties, provided as a comma-separated list of key-value pairs
(`prop1=value1,prop2=value2`).

### --wait\_timeout \<duration>

For how long to wait until the instance becomes ready before giving up.
Defaults to `2m0s`.

### --disable-pty, -T

Disable pseudo-terminal allocation for the SSH session.

### --force-pty, -t

Force pseudo-terminal allocation for the SSH session, even when it wouldn't
otherwise be allocated.

### --ssh\_agent, -A

If specified, forwards your local SSH agent connection to the temporary
instance.

## Related Topics

* [nsc ssh](https://namespace.so/docs/reference/cli/ssh.md)
* [nsc create](https://namespace.so/docs/reference/cli/create.md)


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