How do you SSH into an AI agent's cloud computer?
Three ways to get a shell on an Orgo computer: Direct SSH with your key, orgo ssh from the CLI, and the bash API, and when to use each.
Turn on Direct SSH for a Linux computer, paste your public key, and connect with the command the SSH tab shows: ssh -p <port> root@<host>. That is a real SSH server, so OpenSSH, editors and any tool that asks for a host, port, user and key work with it. For a quick terminal with no key, orgo ssh <name> from the Orgo CLI opens a shell over a WebSocket instead. An agent loop that only needs to run a command and read the output can call POST /computers/{id}/bash.
| Direct SSH | orgo ssh <name> | Bash API | |
|---|---|---|---|
| What it is | An SSH server over TCP | A terminal over a WebSocket | One command per request |
| Credential | Your public key | Your orgo login | An API key |
| Works with OpenSSH and editors | Yes | No | No |
| Interactive | Yes | Yes | No |
| Suited to | Editors, scripts, tools that speak SSH | A quick look from your terminal | An agent that runs commands and reads output |
Sources: Connect with SSH, CLI, Execute bash.
Direct SSH from the dashboard
- Open the computer's ⋯ menu and choose SSH, or open Settings and the SSH tab.
- Paste your public key, the contents of a
.pubfile such as~/.ssh/id_ed25519.pub. Never paste the private key. - Press Enable SSH.
The tab then shows the command:
ssh -p <port> root@<host>The host is the server your computer runs on, and the port is your computer's own. Port 22 on that address is the server, not your computer. If the tab says "Key saved. Restart to activate it.", restart the computer once from its ⋯ menu and reopen the tab.
To make a key:
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pubDirect SSH through the API
Everything in the tab works with an API key that has the Control permission: read to get the settings, write to turn SSH on or off. Three kinds of key are refused:
- A key for one computer, or the computer's own
ORGO_API_KEY:403withcomputer_scopeorcomputer_key. - A key scoped to another workspace:
403withworkspace_scope_mismatch. - A restricted or expiring key on a computer that holds its own key:
403withcomputer_key_held. Use a full access key that never expires, or sign in.
Add your public key. Calling it again replaces all the keys on the computer.
curl -X POST https://www.orgo.ai/api/computers/$COMPUTER_ID/ssh \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"public_key\": \"$(cat ~/.ssh/id_ed25519.pub)\"}"The answer has enabled, ssh_host_port, pending and requires_restart. On a running computer the key usually goes in at once. If requires_restart is true, restart the computer once (Turn on SSH).
Get the command:
curl https://www.orgo.ai/api/computers/$COMPUTER_ID/ssh \
-H "Authorization: Bearer $ORGO_API_KEY"{
"enabled": true,
"authorized_key_set": true,
"ipv4_host": "203.0.113.10",
"ipv4_port": 20314,
"ipv6_address": null,
"ssh_user": "root",
"ssh_command": "ssh -p 20314 root@203.0.113.10"
}Check enabled before using the rest: after SSH is turned off, the port stays reserved, so the last port and command can still be returned. ipv6_address is always null; there is no IPv6 endpoint yet (Get SSH settings).
Turn it off when the job is done:
curl -X DELETE https://www.orgo.ai/api/computers/$COMPUTER_ID/ssh \
-H "Authorization: Bearer $ORGO_API_KEY"This removes the saved keys and, on a running computer, deletes /root/.ssh/authorized_keys at once, including keys added there by hand. revoked_in_guest: false means the computer was not reachable at that moment (Turn off SSH).
Editors and other tools
Tools that ask for an SSH endpoint want the host and port from the tab (or ipv4_host and ipv4_port), the user root, and your private key. For OpenSSH, a ~/.ssh/config entry:
Host agent-1
HostName 203.0.113.10
Port 20314
User root
IdentityFile ~/.ssh/id_ed25519Then ssh agent-1 connects. In VS Code, install the Remote-SSH extension, add the entry above, and connect to agent-1 in the Remote Explorer.
orgo ssh
Install the CLI, sign in once, and open a shell by computer name (CLI):
curl -fsSL https://orgo.ai/install.sh | bash
orgo login
orgo ssh agent-1It starts in /root/Desktop; change that with --cwd. To leave, type ~. at the start of a line, press Ctrl+C twice within 800 ms, or use Ctrl+D or exit. A single Ctrl+C goes to the remote process.
The bash API
POST /computers/{id}/bash runs one command and returns combined stdout and stderr plus exit_code (Execute bash):
curl -X POST https://www.orgo.ai/api/computers/$COMPUTER_ID/bash \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "ls -la /root/Desktop", "timeout": 60}'success: truemeans only that the command ran. Readexit_code.- Without
timeouta command gets 200 seconds; a value is clamped to 1 to 300. On Linux, a command killed by the timeout returnsexit_code: -1with truncated output. - On Windows the endpoint runs PowerShell. A timeout there returns
exit_code: 124anderror: "timeout".
Who and which computers
- Direct SSH is for Linux computers. Others return
400 SSH_UNSUPPORTED_OS. - The workspace owner and Full access members can turn it on, change keys and turn it off. Can chat members get
403 workspace_read_only, and share-link guests are refused too. - Accepted keys:
ssh-ed25519,ssh-rsa,ecdsa-sha2-*,sk-ssh-ed25519@openssh.comandsk-ecdsa-sha2-*@openssh.com. Put one key per line to allow several, up to 16 KB in total. Saving replaces every key, so to add a teammate's key include yours too, and to remove one, save the others. - You log in as
root.
Restarts and moves
- A regular computer keeps its host and port across a restart. Sessions drop during the reboot.
- A dedicated GPU computer gets a new port on every restart. The restart answers
202with anoperation, whose result has the new host, port and command;GET /computers/{id}/sshreturns it too. - After a stop and start, or a move to another server, host and port can both change. Read them again; do not cache them.
- A suspended computer takes no connections until it wakes. One moved to storage has no address:
GET /computers/{id}/sshreturns409 computer_asleep. You can still save keys or turn SSH off while it sleeps.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Permission denied (publickey) | The key is not on the computer yet, or you used another private key | Paste the public key again, restart once if asked, and connect with ssh -i ~/.ssh/<key> -p <port> root@<host> |
Connection refused or a timeout | Wrong port, or the computer is not running | Use the port from the SSH tab, never 22, and start or wake the computer |
Connection refused on the right port, computer running | No SSH server is listening inside it | Run pgrep -a sshd through orgo ssh or the bash API. No output means none is running; contact support |
| It worked yesterday | The computer moved, so host and port changed | Read the SSH settings again |
The API's other refusals: 400 with no code for a missing, empty, oversized or invalid public_key; 402 when the computer's access has ended; 403 GUEST_RESTRICTED for a share-link guest; 403 key_permission for a key without Control. When contacting support, the docs ask for the output of ssh -v -p <port> root@<host>.