scratch ssh.md
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 and nsc ssh.
Usage
nsc scratch ssh [--machine_type [os/arch:]<cpu>x<mem>] \
[--selectors <name1=value1,name2=value2>] \
[--wait_timeout <duration>] \
[-T] [-t] [-A]
Example
nsc scratch ssh
85a32emcg99ii:~#
Options
--machine_type [os/arch:]x
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
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.