SSH into your runtime
Every running Neural Studio runtime accepts SSH from your own machine, so you
can use ssh, scp, rsync, VS Code Remote-SSH, Cursor, or JetBrains
Gateway against it exactly as you would against any cloud box. Nothing is
exposed on the VM: the runtime only ever opens an outbound tunnel to the
session gateway, and the ns CLI relays your SSH client through that tunnel.
Key authentication stays end to end between your SSH client and the runtime's
sshd; the platform authorizes which runtime you may reach and pipes bytes.
One-time setup
-
Register your public key. Settings → SSH keys → Add key, and paste the contents of your
~/.ssh/id_ed25519.pub(or another supported type). The key is installed on every runtime in the workspaces you belong to, and pushed live to the ones already running. -
Install the CLI.
pip install neural-studioprovides thenscommand. -
Create an API key. Settings → API keys → Create key (full access), then put it where the CLI looks for it:
export NEURAL_STUDIO_API_KEY=ns_... # or, persistently: mkdir -p ~/.config/neural-studio printf 'api_key = "ns_..."\n' > ~/.config/neural-studio/config.tomlThe CLI talks to the platform with this key; a runtime's own session key cannot be used to open SSH.
Connecting
Find the runtime id in the notebook's runtime bar (SSH → copy id, or the
ssh-config block it shows). Then:
ns ssh-config --install <runtime-id>
ssh ns-<runtime-id>
ns ssh-config --install writes a fenced Host ns-<runtime-id> block into
~/.ssh/config whose ProxyCommand is ns ssh --stdio <runtime-id>.
Re-running it replaces the block in place. The login user is user (the same
account your notebook kernel and terminal run as); the CLI fills it in from the
API, and --user overrides it if you ever need to.
ns ssh <runtime-id> [ssh args...] is a shortcut for ssh ns-<runtime-id>.
Host keys are recorded in ~/.ssh/known_hosts.neural-studio on first
connect (StrictHostKeyChecking accept-new). Every runtime is a fresh VM, so
a new runtime under the same id will present a new host key; delete the old
line from that file if ssh complains.
Files
scp and rsync work unmodified once the config block is installed:
scp ./data.parquet ns-<runtime-id>:~/workspace/
rsync -av --progress ./project/ ns-<runtime-id>:~/workspace/project/
~/workspace on the runtime is your durable workspace filesystem — anything
you copy there survives the runtime stopping. The rest of the home directory
does not.
VS Code Remote-SSH
- Install the Remote - SSH extension.
- Run Remote-SSH: Connect to Host… and pick
ns-<runtime-id>(it appears automatically once the config block is installed). - Open the folder
/home/user/workspace.
VS Code installs its server under ~/.vscode-server on the runtime; that
directory is not durable, so the first connect to a new runtime downloads it
again.
Cursor and JetBrains Gateway
Cursor uses the same Remote-SSH flow as VS Code (Connect to Host… →
ns-<runtime-id>). JetBrains Gateway: New connection → SSH → host
ns-<runtime-id> (the ProxyCommand in ~/.ssh/config is honoured), then
open /home/user/workspace.
Revoking a key
Settings → SSH keys → Revoke. The key is removed from every running runtime within seconds, and never installed on a new one. Rotating a key (replace the public key in place) behaves the same way: the old key stops working, the new one starts working, on running runtimes immediately.
Troubleshooting
ns: gateway rejected the SSH relay upgrade— the runtime is notrunningwith a connected tunnel (it is still starting, or has stopped), or the ticket was refused. Check the runtime's status in the app and retry.Permission denied (publickey)— your key is not registered, was revoked, orsshis offering a different key.ssh -v ns-<runtime-id>shows which keys were tried;-i ~/.ssh/id_ed25519pins one.ns: No API key found— setNEURAL_STUDIO_API_KEYor the config file as above. TheProxyCommandrunsnsfrom your login shell'sPATH, so the key must be visible to that shell, not only to a virtualenv.ns: the session gateway host is not configured— the environment you are pointed at has no gateway; checkNEURAL_STUDIO_API_URL.- You are not a member of the runtime's workspace — the API answers 404 for runtimes you cannot see; SSH is limited to workspaces you belong to.