scp and sftp. This gives you the same control you’d have on a local GPU box, just running on Baseten-managed hardware.
Unlike rSSH, which tunnels through VS Code or Cursor, SSH is terminal-first and works with any OpenSSH-compatible tool.
Prerequisites
SSH sessions must be enabled for your Baseten workspace. Contact support to request access.
- Baseten account: Sign up and generate an API key.
-
uv: This guide uses
uvxto run Truss commands without a separate install step. Log in to Baseten: - OpenSSH client: Pre-installed on macOS and Linux. On Windows, use the OpenSSH optional feature or WSL.
Configuration
To enable SSH access on a training job, setsession_provider to SSH in your config.py:
config.py
trigger=ON_STARTUP so the session is available as soon as the job starts running. The default is ON_DEMAND, which activates the session on your first SSH connection; see Trigger modes for all options.
Training jobs support H200 and H100 GPUs. For all InteractiveSession fields, see the SDK reference. For supported compute, see Compute resources.
Quick start
This walkthrough uses the MNIST PyTorch example to push a training job with SSH enabled, then connects to the container from your terminal.1. Set up your machine
Runuvx truss ssh setup once to configure OpenSSH:
ProxyCommand helper, and adds a wildcard Host entry to ~/.ssh/config. You only need to do this once per machine.
The expected output is:
/Users/<you>is your local home directory.<remote>is your default remote from~/.trussrc(typicallybaseten).
WARNING: Existing SSH keypair found at <path>, reusing it. You can safely ignore it.
2. Clone the example
3. Configure and push the job
Editconfig.py to add an interactive_session with session_provider=SSH, as shown in Configuration. Then push:
<job_id>is your new training job’s ID. Note it down; you’ll use it to connect in the next step.<project_id>is the Baseten-assigned ID for the training project.
4. Connect
Once the job is running, find its ID withuvx truss train view, then SSH in:
abc1234:
root@baseten-training-job-<job_id>-multinode-0:~#.
By default, your source files are extracted to /b10/workspace (available as $BT_WORKING_DIR). If you set enable_baseten_workdir=False, Baseten uses your base image’s WORKDIR instead.
How it works
When you runssh training-job-<job_id>-<node>.ssh.baseten.co, Baseten authenticates you using the API key stored by uvx truss ssh setup, issues a short-lived SSH certificate, and routes the connection to the correct training job. Certificates refresh automatically on every connection, so you never need to manage keys or tokens manually.
Hostname format
| Segment | Description | Example |
|---|---|---|
job_id | Training job ID. Find it with uvx truss train view or in the Baseten dashboard. | abc1234 |
node | Node index, starting at 0. | 0 |
IDE integration
Becauseuvx truss ssh setup configures standard OpenSSH, tools that speak SSH can connect with the same hostname:
- VS Code: Install the Remote - SSH extension, then connect to
training-job-<job_id>-<node>.ssh.baseten.co. - Cursor: Use the built-in SSH remote feature with
training-job-<job_id>-<node>.ssh.baseten.co.
Multi-node jobs
For multi-node training jobs, specify the node index in the hostname. Node 0 is the leader:File transfer
Usescp or sftp with the same hostname to transfer files:
Multiple remotes
If you only have one remote configured in~/.trussrc, you can skip this section. Baseten uses it automatically.
If you have multiple remotes, include the remote name in the hostname so the proxy script knows which credentials to use:
baseten-dev remote:
Session management
For how to view session status, change triggers, and extend session expiry, see the Remote access overview.Troubleshooting
”Invalid job id: must be a valid hash id”
Check that the job ID in the hostname is correct. Find your job ID withuvx truss train view or in the Baseten dashboard.
”SSH keypair not found” or “command not found”
Runuvx truss ssh setup to configure your machine.
Connection refused or job unreachable
SSH requires the training job to be in theRUNNING state. Check with:
session_provider=InteractiveSessionProvider.SSH is set in your Configuration.