Black Friday: 10% off every GPU you launch, no code needed. Until 30 Nov. Rent a GPU

Arrakis / Blog / Start here

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

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:

Shell
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, or over the API with a token that has the manage scope:

Shell
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:

Shell
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:

Shell
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:

Shell
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:

Shell
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.

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 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 covers that).

New to rented GPUs altogether? Start with rent a cloud GPU in five minutes. Working in notebooks? Jupyter on a cloud GPU 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.

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Rent the GPUs in this post

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Lowest price now, per GPU-hour. Billed per started hour; stop any time.

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

Every postRSS feed