GuidesSSH Key Authentication
SSH Key Authentication
Stop using passwords. SSH keys are faster, more secure, and can't be brute-forced.
SSH keys use public-key cryptography. You keep the private key; the server only stores the public key. Even if the server is compromised, your private key stays safe.
Generate a Key Pair
Run this on your local machine (not your server):
macOS / Linux / Windows (PowerShell)
ssh-keygen -t ed25519 -C "your@email.com"When prompted for a file location, press Enter for the default (~/.ssh/id_ed25519). Set a passphrase for extra protection (optional but recommended).
Copy Key to Server
macOS / Linux
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@YOUR_IPWindows PowerShell
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh user@YOUR_IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"Disable Password Login (Recommended)
Only do this after confirming your SSH key works — you could lock yourself out.
bash
# On your server:
sudo nano /etc/ssh/sshd_config
# Find and set these lines:
PasswordAuthentication no
PubkeyAuthentication yes
ChallengeResponseAuthentication no
# Save and restart SSH:
sudo systemctl restart sshManaging Keys in Your Dashboard
You can add SSH public keys in Account → SSH Keys. Keys stored there are automatically added to new servers you provision.
Using Multiple Keys
Create a ~/.ssh/config file to manage multiple servers easily:
~/.ssh/config
Host myserver
HostName 185.172.173.1
User root
IdentityFile ~/.ssh/id_ed25519
Host staging
HostName 185.172.173.2
User deploy
IdentityFile ~/.ssh/id_ed25519_stagingNow connect with just ssh myserver instead of the full command.