Help Running your server First steps
Make an SSH key and use it
Make a key on your computer, put it on your server and in the portal, and give your server a short name so you can type ssh web-01.
An SSH key is a pair of files. The public key goes on your server; the private key never leaves your computer. Nobody can guess a key the way they guess a password.
Make a key#
Windows
Open PowerShell or Windows Terminal and run:
ssh-keygen -t ed25519 -C "alex@laptop"Press Enter to save it in the usual place, C:\Users\alex\.ssh\id_ed25519. Then type a passphrase, twice. A passphrase protects the key if your computer is ever lost or copied.
macOS
Open Terminal and run:
ssh-keygen -t ed25519 -C "alex@laptop"Press Return to save it in the usual place, ~/.ssh/id_ed25519. Then type a passphrase, twice. A passphrase protects the key if your Mac is ever lost or copied.
Linux
Open a terminal and run:
ssh-keygen -t ed25519 -C "alex@laptop"Press Enter to save it in the usual place, ~/.ssh/id_ed25519. Then type a passphrase, twice. A passphrase protects the key if your computer is ever lost or copied.
-C is a label to tell your keys apart. You now have id_ed25519, the private key, and id_ed25519.pub, the public key.
Put the key on your server#
Do this once per server. You'll be asked for the server's password one last time.
Windows
Windows has no ssh-copy-id, so this one line does the same job. Paste it into PowerShell, with your server's address:
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"macOS
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]Linux
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]Now connect again. If you set a passphrase, SSH asks for that instead of the server's password:
ssh [email protected]Each line of ~/.ssh/authorized_keys on the server is a key that may log in. To remove one, delete its line.
Add it to the portal too#
Every new VPS is built with the keys in the portal. Open SSH keys from the side menu and paste the contents of id_ed25519.pub. To print it:
Windows
type $env:USERPROFILE\.ssh\id_ed25519.pubmacOS
cat ~/.ssh/id_ed25519.pubLinux
cat ~/.ssh/id_ed25519.pubSee Add an SSH key. A key added there doesn't reach a server you already have until you push it from the server's Access tab: see Add and revoke SSH keys.
Stop typing the passphrase#
An SSH agent holds your unlocked key, so you type the passphrase once per login, not once per connection.
Windows
The agent is built in but off. Open PowerShell as administrator and run:
Get-Service ssh-agent | Set-Service -StartupType Automatic; Start-Service ssh-agentThen, in an ordinary PowerShell window, add your key:
ssh-add $env:USERPROFILE\.ssh\id_ed25519macOS
macOS can keep the passphrase in your keychain:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519Add UseKeychain yes and AddKeysToAgent yes to the Host * part of your config file (next section) and it will be unlocked for you after every restart.
Linux
Most desktops start an agent for you and ask for the passphrase the first time you use the key. If yours doesn't:
ssh-add ~/.ssh/id_ed25519Give your server a short name#
A file called config (no extension) in your .ssh folder lets you type ssh web-01 instead of the whole line.
Windows
Open it in Notepad. If it doesn't exist yet, Notepad offers to create it:
notepad $env:USERPROFILE\.ssh\configmacOS
Create it if it isn't there, and open it in TextEdit:
touch ~/.ssh/config && open -e ~/.ssh/configLinux
nano ~/.ssh/configAdd an entry for each server. Host is the short name you'll type:
Host web-01
HostName 203.0.113.10
User alex
IdentityFile ~/.ssh/id_ed25519
Host *
ServerAliveInterval 60Save it, and from then on:
ssh web-01The same name works with scp, rsync and sftp: see Move files to and from your server.
Lost the key?#
Make a new one, and take the old one off every server and out of the portal. Can't log in at all? Use the console on the server's page: see Locked out of SSH.
Still stuck? Open a ticket and say which guide you followed.