> ## 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`](/docs/reference/cli/create) and [`nsc ssh`](/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

<h3 id="--machine_type-osarchcpuxmem">
  \--machine\_type \[os/arch:]\<cpu>x\<mem>
</h3>

Specify the machine shape for the temporary instance. Follows the same
`[os/arch:]<cpu>x<mem>` format as [`nsc create`](/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.

<h3 id="--selectors">
  \--selectors
</h3>

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`).

<h3 id="--wait_timeout-duration">
  \--wait\_timeout \<duration>
</h3>

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

<h3 id="--disable-pty--t">
  \--disable-pty, -T
</h3>

Disable pseudo-terminal allocation for the SSH session.

<h3 id="--force-pty--t">
  \--force-pty, -t
</h3>

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

<h3 id="--ssh_agent--a">
  \--ssh\_agent, -A
</h3>

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

## Related Topics

* [nsc ssh](/docs/reference/cli/ssh)
* [nsc create](/docs/reference/cli/create)
