Loading…
Loading documentation...
Best practices for generating, rotating, and securing SSH keys for instance access.
SSH keys provide secure, password-less authentication to your instances. This guide covers generating, adding, rotating, and securing your SSH keys.
We recommend Ed25519 keys for the best security and performance:
# Generate an Ed25519 key
ssh-keygen -t ed25519 -C "your-email@example.com"
# Or RSA (4096-bit minimum)
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
When prompted, save to the default location (~/.ssh/id_ed25519) and set a strong passphrase.
~/.ssh/id_ed25519.pub)Add/remove keys via Access > SSH keys in the dashboard, or POST/DELETE /api/v1/ssh-keys (see API docs). The sau CLI supports ssh-keys list only.
curl -X POST https://serversareup.com/api/v1/ssh-keys \
-H "Authorization: Bearer $SAU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "work-laptop",
"publicKey": "ssh-ed25519 AAAA... your-email@example.com"
}'
Every active key in your account (or your organization's keys, for an organization's server) is installed for the sauuser account when a Linux server is built or rebuilt. A key you add later reaches a server that is already running only if you add it there yourself (see Key Rotation below).
What you can create today: Buy any product marked Available in checkout and it is set up automatically; products marked Coming soon have no checkout yet. The
sauCLI does not create instances.
Turn on public SSH on the server's page, then copy the command from its How to connect card. It looks like this:
ssh sauuser@SERVER_ADDRESS -p SSH_PORT
Root cannot sign in. Run administrative commands with sudo, or start a root shell with sudo -i.
After verifying SSH key access works, you can turn off password sign-in. The console's terminal signs in with the server's password, so it stops working after this; use SSH from your own computer instead.
# On your server. sshd keeps the first value it reads, and it reads sshd_config.d in name order,
# so this file wins over the one that turned passwords on when the server was built.
echo 'PasswordAuthentication no' | sudo tee /etc/ssh/sshd_config.d/00-no-passwords.conf
sudo sshd -t && sudo systemctl reload ssh
sudo sshd -T | grep -i '^passwordauthentication'
The last line should print passwordauthentication no. To turn passwords back on, delete that file and reload ssh again.
Rotate SSH keys periodically or whenever a team member leaves:
Remove keys via Access > SSH keys or DELETE /api/v1/ssh-keys/{id} (see API docs). The sau CLI supports ssh-keys list only.
To add a key to a server that is already running, or drop one from it:
ssh sauuser@SERVER_ADDRESS -p SSH_PORT 'mkdir -p -m 700 ~/.ssh && cat >> ~/.ssh/authorized_keys' < ~/.ssh/new_key.pub
ssh sauuser@SERVER_ADDRESS -p SSH_PORT "sed -i '/old-key-comment/d' ~/.ssh/authorized_keys"
| Practice | Why |
|---|---|
| Use Ed25519 keys | Stronger security, smaller keys, faster |
| Set a passphrase | Protects the private key if your device is compromised |
| Use ssh-agent | Avoid typing your passphrase repeatedly |
| One key per device | Revoke a single device without affecting others |
| Never share private keys | The private key should never leave the device that generated it |
| Disable password auth | Eliminates brute-force password attacks |
| Rotate keys regularly | Reduces risk from compromised keys |
| Problem | Solution |
|---|---|
| Permission denied | Check that the correct key is being offered: ssh -v root@IP |
| Key not accepted | Verify the public key format is correct when adding to your account |
| Agent forwarding issues | Run ssh-add to add your key to the agent |
Every Servers Are Up virtual machine and container includes an integrated HTML5 browser-based SSH, RDP, and VNC console in your dashboard, default-off inbound firewall rules with per-IP allow-lists, and full programmatic control via REST API v1 and Model Context Protocol (MCP). Explore our Virtual Datacenter Plans or reach out to Servers Are Up Support.