SSH keys
Save public keys to your account and choose one for each rental.
Each rental has one SSH public key, which can log in as root. You choose it when you rent, and you can change it later.
Make a key
If you don't have one, run:
ssh-keygen -t ed25519This writes a private key, ~/, and a public key, ~/. Only the public key ever goes to Legion.
Save keys to your account
Open Settings, then SSH keys. Paste one line from a . file, give it a name and press Save key.
Saved keys are yours, in this organization, in every browser you sign in from. Only you can see them.
Legion accepts
ssh-ed25519,ssh-rsa(2048 bits or more),ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.andcom sk-ecdsa-sha2-nistp256@openssh..com A key is one line, up to 8192 characters.
If you paste a private key by mistake, Legion refuses it before it's sent.
Choose a key when you rent
The rent form lists your saved keys. None is chosen for you: pick one each time. You can also paste a different key, and save it as you rent.
Removing a saved key from your account doesn't affect rentals that already use it. To take access away from a key, change the rental's key.
Change or revoke the key of a rental
A rental has one key, and you can replace it while the rental exists, running or stopped. Do it when you lose a laptop, rotate your keys, or when someone who held the private key leaves your organization.
Open the rental and go to its Connect tab. Under SSH key you see the fingerprint of the key it has now.
Press Change SSH key, then choose one of your saved keys or paste a different public key. You can save a pasted key to your account.
Press Review. The page shows the current and the new fingerprint and what happens next. Press Replace SSH key to confirm.
The rental isn't restarted and your files stay. The SSH gateway accepts only the new key from the host's next sync, at most 30 seconds later, and closes the open SSH sessions that used the old key within about 10 seconds after that: 40 seconds at the most in all. From then on the old private key can't connect. The container's authorized_ file is rewritten in place. The web terminal signs in with a certificate, not the rental's key, so it isn't affected.
Only an owner or a member can change a rental's key. Pasting the same key again changes nothing. A private key is refused, as everywhere else.
A rental that is being deleted, is deleted or has failed can't take a new key. If the rental's host runs an older Legion agent that can't change a key while the container runs, the page says so: stop the rental, change the key, then start it again.
The same change is available through the API: updateRental with ssh_. The key itself is never sent back, only ssh_, the fingerprint ssh-keygen -l prints.