# SSH Key for a GPU Server: Share, Add and Rotate Safely

Published 5 November 2026, updated 7 November 2026. 5 min read. For: Developers and small teams who share rented GPU machines.

## Key facts

- Several people can SSH into one rented GPU: pick several saved keys when you rent, or add a teammate's key to the running machine later.
- Adding a key to a running machine, in the console or with POST /v1/instances/{id}/ssh-keys, changes nothing else on it.
- To rotate a key everywhere, replace the saved key with machines included: every running machine that had the old key gets the new one.
- When someone leaves, take their key off each running machine, which locks the door today, then delete the saved key so nobody picks it again.
- Arrakis takes public keys only and refuses private key material; API tokens never read a key back, only names, ids and fingerprints.

An SSH key for a GPU server is a five-minute job until the second person needs in. Then it is the pasted private key in a chat, the shared login nobody can revoke, the laptop that got stolen with the only key to a machine mid-run. Arrakis handles keys the way a team actually works: save several, pick several when you rent, add one to a running machine, and rotate a key on every machine at once.

## One key per person, per device

The rule that makes everything else easy: every person, and every laptop, gets its own key. Never share a private key, never copy one onto a rented machine. Then giving access is adding a public key, and taking it away is removing one.

Make a key and read its fingerprint:

```sh
ssh-keygen -t ed25519 -C "dana@laptop-2026"
ssh-keygen -lf ~/.ssh/id_ed25519.pub
```

The comment after `-C` is how you will recognise the key in a list. The second command prints its fingerprint, `SHA256:...`, which is how Arrakis names keys on a machine. Arrakis never returns a key's text to an API token, only names, ids and fingerprints, and it refuses private key material outright.

## Save the team's keys

Save each public key on SSH keys in the [console](/console/), or over the API with a token that has the manage scope:

```sh
curl -X POST https://arrakis.goodailabs.com/v1/ssh-keys \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "dana-laptop", "public_key": "ssh-ed25519 AAAA... dana@laptop-2026"}'
```

## Pick several keys when you rent

The Rent sheet lets you pick saved keys, and every one of them can log in as root. Over the API, `ssh_key_ids` takes several saved keys by id:

```sh
curl -X POST https://arrakis.goodailabs.com/v1/instances \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"node_id": "<node>", "name": "shared-h100", "termination_hours": 8,
       "ssh_key_ids": ["<dana key id>", "<sam key id>"]}'
```

Agents do the same: `rent_gpu` takes `ssh_key_ids`, so an agent can rent a machine that you and a teammate can both log in to, without ever reading a key.

## Add a key to a running machine

A teammate joins halfway through a run. Do not stop the machine and lose the disk. On the machine's page, choose SSH keys, tick a saved key or paste a public one, and save. Or:

```sh
curl -X POST https://arrakis.goodailabs.com/v1/instances/<id>/ssh-keys \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"ssh_key_ids": ["<sam key id>"]}'
```

`public_keys` takes pasted keys instead. Adding is quick, and nothing else on the machine changes. `GET /v1/instances/<id>/ssh-keys` lists who can log in now, by fingerprint and saved name.

## Take a key off

Someone leaves the project. Set the machine's keys to exactly the ones that should stay:

```sh
curl -X PUT https://arrakis.goodailabs.com/v1/instances/<id>/ssh-keys \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"keep": ["SHA256:<dana fingerprint>"]}'
```

Every key not in `keep` is taken off. To do that, Arrakis logs in to the machine once with a one-time key, which goes too, so it takes up to half a minute. At least one key must stay. One catch worth knowing: keys someone added on the machine by hand, straight into `authorized_keys`, are taken off as well. Manage keys through Arrakis and the list stays true.

Then delete their saved key from SSH keys so nobody picks it for the next rental. Order matters: deleting a saved key keeps it off future rentals, while taking it off each running machine is what locks the door today.

## Rotate a key everywhere at once

A laptop is lost, or a key is just old. Rotation should not mean visiting ten machines.

Replace the saved key. In the console that is Replace key on SSH keys, with "Swap it on my running machines that have the old key" ticked. Over the API:

```sh
curl -X PUT https://arrakis.goodailabs.com/v1/ssh-keys/<key id> \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"public_key": "ssh-ed25519 AAAA... dana@new-laptop", "machines": true}'
```

The saved key keeps its id, so scripts that rent with `ssh_key_ids` keep working. Every running machine that had the old key gets the new one instead, the old one stops working there, and the answer lists each machine and whether its swap went through. Swapping takes up to half a minute.

The safe order:

1. Make the new key on the new device.
2. Replace the saved key, machines included.
3. Log in with the new key before you close any old session.
4. Delete the old private key.

Agents rotate on a single machine with `instance_ssh_keys`: add the new key and remove the old one's fingerprint in one call.

## Who can change what

Keys follow the same token scopes as everything else, which matters when an agent or a script holds the token:

| Action | Scope it needs |
|---|---|
| List the keys on a machine | read |
| Add or take off keys on a running machine | rent |
| Save, replace or delete keys on the account | manage |

So an agent with the usual read and rent token can let a teammate into a machine it rented (by saved key id, or a pasted public key) and can rotate keys on that machine, but cannot add new keys to your account or replace the ones you saved.

## Which move for which moment

| Situation | Move |
|---|---|
| A teammate needs in for one run | Add their key to the running machine |
| Someone leaves the project | Take their key off each running machine, then delete the saved key |
| A laptop is lost | Replace the saved key with machines included, today |
| An agent rents on your behalf | Pass `ssh_key_ids` for every person who needs in |
| CI needs a machine for one job | A throwaway key per run, gone with the runner |

That last row has a full script in [a GPU runner for CI](/blog/ci-pipeline-rent-gpu.html.md).

## Make logging in boring

The machine's page offers an SSH config entry to copy. Paste it into `~/.ssh/config` and `ssh my-machine` just works, and so does VS Code Remote-SSH:

```text
Host my-machine
  HostName <host>
  User root
  Port <port>
```

Add `IdentityFile ~/.ssh/id_ed25519` if you keep several keys on one laptop.

## Keys are access, not secrecy

Keys decide who logs in. They do not make the machine private from its host: machines run on independent hosts who control the hardware and can see what runs on it. Keep credentials and regulated data off rented machines, pass short-lived tokens in over SSH when a job needs them, and read [Security](/docs/security.html.md) for the full picture. And whatever keys are on a machine, everything on its disk is deleted when it stops, so copy results off first ([Rent and connect](/docs/rent.html.md) covers that).

New to rented GPUs altogether? Start with [rent a cloud GPU in five minutes](/blog/rent-first-cloud-gpu.html.md). Working in notebooks? [Jupyter on a cloud GPU](/blog/jupyter-on-cloud-gpu.html.md) uses the same keys for its tunnel.

## Give the team access the right way

Save one key per person and device, rent with all of them, and rotate in one call when something changes. [Manage your SSH keys](/console/#/keys).

New here? Use code [FIRST25](/console/?code=FIRST25) for $25 off your first deposit of $50 or more, until 31 December 2026.

## Rent the GPUs in this post

- [H100](/gpus/h100.html.md): [the live price](/gpus/h100.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=H100) or with the MCP tool rent_gpu.
- [RTX 4090](/gpus/rtx-4090.html.md): [the live price](/gpus/rtx-4090.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=RTX 4090) or with the MCP tool rent_gpu.
- [B200](/gpus/b200.html.md): [the live price](/gpus/b200.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=B200) or with the MCP tool rent_gpu.

## Questions

**Can several people SSH into one rented GPU?** Yes. Pick several saved keys when you rent, or add a teammate's key to the running machine later. Each key logs in as root.

**How do I add an SSH key to a GPU server that is already running?** Open the machine in the console and choose SSH keys, or call POST /v1/instances/{id}/ssh-keys with saved key ids or public keys. Adding a key changes nothing else on the machine.

**How do I rotate an SSH key on every machine at once?** Replace the saved key (Replace key in the console, or PUT /v1/ssh-keys/{key_id} with machines set to true). Every running machine that had the old key gets the new one, and the old one is taken off.

**Does Arrakis ever see my private key?** No. Arrakis takes public keys only and refuses private key material. API tokens never read a key back, only names, ids and fingerprints.

## More from the blog

- [Docker Image on a GPU Server: Bring Your Own, Private Too](/blog/custom-docker-image-gpu.html.md): Run your own Docker image on a GPU server by the hour: any public image, or a private one from Docker Hub, ghcr.io, ECR, NGC or your own registry.
- [AI Startup GPU Budget: The First Six Months, No Idle Burn](/blog/ai-startup-gpu-budget.html.md): An AI startup GPU budget for the first six months: a prepaid balance as the ceiling, a spend cap per token, removal times, and no GPUs billing while idle.
- [GPU price per GB: the metric that matters, from live prices](/blog/gpu-price-per-gb-memory.html.md): GPU price per GB of memory, from live hourly prices: the formula, a table for ten GPUs, break-even ratios, a one-line script, and when the metric misleads.

Every post: [/blog](/blog.html.md). RSS: [/blog/feed.xml](/blog/feed.xml).
