rig login, ssh <workspace> opens a shell in any running workspace, and the same name works with scp, sftp, rsync, and tools that read your SSH config.
Prerequisites
- The Rigbox CLI, signed in with
rig login. - OpenSSH on your machine (
ssh,ssh-keygen, andssh-keyscan). macOS and most Linux distributions include it. - A running workspace. List yours with
rig workspace ls.
How the CLI sets up SSH
rig login, rig ssh add, and the workspace commands that print an SSH command (rig workspace spawn, start, restart, and ssh-info) set up SSH access from the machine you run them on:
- Your key. The CLI uses
~/.ssh/id_ed25519.pub, or~/.ssh/id_rsa.pubif that is the key you have. When you have neither, it creates an ed25519 key pair at~/.ssh/id_ed25519, without a passphrase. It registers the public key on your account aslaptop-<hostname>unless the key is already there, and waits for running workspaces to pick it up. - A host entry per workspace. The CLI writes
~/.config/rigbox/ssh_configwith oneHostentry for each of your workspaces, and adds anIncludeline for that file, with a comment, to the top of~/.ssh/config. That is the only change it makes to your own SSH config. - Trusted host keys. The first time the CLI sets up a host, it records the gateway’s host keys in
~/.config/rigbox/known_hosts, so SSH clients connect without a first-connect prompt. That matters for tools that can’t answer one.
~/.config/rigbox/ssh_config looks like this:
<name>-<id suffix>. When two workspaces share a name, or you already use that name for a host in your own SSH config, the entry keeps only the login name. rig workspace ssh-info shows which alias to use.
The CLI rewrites the file from your workspace list, so edits to it are lost; rig workspace ls and rig workspace rm keep it current. Stopped workspaces have entries too.
Nothing is set up inside a workspace, on a CI runner (CI or GITHUB_ACTIONS set), or when the CLI authenticates with a deploy token.
Connect to a workspace
Use the workspace name:-t when the command needs one, such as an interactive program or a sudo prompt:
~/.ssh/config, including SSH connections in the Claude desktop app, can use the same alias. SFTP is available, so tools that browse or copy files over SFTP work too.
To print the connection details for a workspace:
ssh line is the full command, which works without the managed config. For scripts, --output json returns the same details, including ssh_target and, once access is set up, ssh_alias.
Connecting to the right region
The full SSH target is<WORKSPACE_NAME>-<WORKSPACE_ID_SUFFIX>@<REGION>.rigbox.dev: the workspace name, its ID without the leading ws-, and the host of the region the workspace runs in (today eu-west-1). The CLI takes the host from the workspace record, and the dashboard shows the same command. There is no central rigbox.dev:22 gateway to fall back on.
Older
ssh <name>+rig@rigbox.dev instructions referred to a gateway router that is no longer deployed. If a third-party guide or older script still uses that format, replace it with the workspace alias or the region hostname.Stopped workspaces
A workspace accepts connections only while it is running. Connecting to a stopped workspace fails with a message on standard error that names the command to start it:Forwarding isn’t available
Workspace logins don’t allow port forwarding (-L, -R, -D), agent forwarding (-A), X11 forwarding, or tunnels. Editors that reach their remote server through a forwarded port, such as VS Code Remote-SSH, can’t use this connection. To reach a server running in the workspace, expose it as an app. For Git or other credentials inside the workspace, create them there instead of forwarding your local agent.
Specify an identity file
The managed entries name the key the CLI registered. To use a different key, register it first, then pass it tossh:
SSH config shortcut
The CLI writes these entries for you (see How the CLI sets up SSH). If you turn that off, add your own entry to~/.ssh/config:
File Transfer
scp, sftp, and rsync accept the workspace alias, just like ssh.
Upload a file
Download a file
Upload a directory
sftp my-project.
Using rsync
For larger transfers or repeated syncs,rsync copies only what changed:
rig deploy instead of copying files into its release directory.
Register an SSH Key
rig login registers your default key, so you only need rig ssh add for another key or another machine:
--file, it uses your default public key and creates one if you have none. Without --name, the key is named laptop-<hostname>. To register a specific key under a name you choose:
rig ssh add also sets up the host entries on this machine. If the key is already on your account, rig says so and doesn’t add it again.
Sync Keys to a Workspace
Running workspaces pick up a newly registered key automatically;rig ssh add and rig login wait for them and report each one. If a workspace didn’t pick the key up in time, push your keys to it:
~/.ssh/authorized_keys file.
Managing SSH Keys
List your registered keys
List keys synced to a workspace
authorized_keys file.
Remove a key
Turn off automatic setup
To manage SSH yourself:rig ssh add, or run the workspace commands. Deploys that copy files over SSH still register your key when they need it. The files it already wrote stay in place: remove the Include line from ~/.ssh/config and delete ~/.config/rigbox/ssh_config if you don’t want them. Turn setup back on with rig config set ssh-setup true.
Troubleshooting
Could not resolve hostname
ssh my-project needs the managed entry. Run rig workspace ssh-info --workspace my-project to write it, then check that ~/.ssh/config includes ~/.config/rigbox/ssh_config. If the CLI couldn’t edit ~/.ssh/config, it printed the line to add. When the plain name is taken, the alias is the login name (my-project-ctbxi8lb); ssh-info shows it.
Connection refused
Ifssh reports that the workspace is not running, start it with the command in the message. For other connection failures:
- Check that the workspace is running with
rig workspace ls. - Connect to the host
rig workspace ssh-infoprints; don’t hardcode one. - Check that your network allows outbound SSH on port 22.
Permission denied
If you getPermission denied (publickey):
- Check that your key is registered:
rig ssh ls. If it isn’t, runrig ssh add. - Push your keys to the workspace:
rig ssh sync --workspace my-project. - See which keys
sshoffers:ssh -v my-project.
Permission denied that persists is about the key.
Host key warnings
The CLI keeps workspace host keys in~/.config/rigbox/known_hosts, separate from ~/.ssh/known_hosts. When a new scan disagrees with a key already on file, the CLI adds nothing, and your SSH client reports the mismatch. Check the change through a trusted channel before editing that file, and don’t turn off host key checking to get past it.
Slow connection
If connections feel slow:- Check your network connection.
- Managed entries already send keepalives (
ServerAliveInterval 30). With the fulluser@hostcommand, add-o ServerAliveInterval=60. - For large transfers, prefer
rsyncoverscp.
API Reference
- Add SSH Key - Register a new SSH key
- List SSH Keys - List registered SSH keys
- Delete SSH Key - Remove an SSH key
- Sync Workspace SSH Keys - Sync keys to a workspace
- List Workspace SSH Keys - List keys on a workspace