Skip to main content
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 and nsc ssh.

Usage

Example

Output

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’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.
Last modified on August 20, 2026