Skip to content

Using SSH Keys

An SSH key is a pair of files. The private key stays on your computer. The public key (.pub) goes on the server. The server lets in anyone who holds a private key that matches one of its public keys, without a password.

To install a key on new servers, add it to your workspace in the panel. Read more in SSH Keys.

Terminal window
ssh-keygen -t ed25519 -C "my-laptop"

Press Enter to save it in the default location. We recommend a passphrase. Anyone who copies the private key file also needs the passphrase to use the key.

This creates id_ed25519 (private, never share it) and id_ed25519.pub (public) in the .ssh folder of your computer’s user folder. For a key on a YubiKey or another security key, see Hardware Security Keys.

From Linux or macOS:

Terminal window
ssh-copy-id root@203.0.113.10

From Windows PowerShell:

Terminal window
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@203.0.113.10 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Both append your public key to ~/.ssh/authorized_keys on the server. If SSH still asks for a password, fix the permissions on the server:

Terminal window
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

ssh-agent holds your unlocked keys so you type the passphrase once per session.

On Linux:

Terminal window
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

On macOS, store the passphrase in your Keychain:

Terminal window
ssh-add --apple-use-keychain ~/.ssh/id_ed25519

On Windows, start the agent service once from an administrator PowerShell, then add the key from a regular one:

Terminal window
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519

Add an entry to ~/.ssh/config (.ssh\config in your user folder on Windows) to connect with a short name:

Host my-server
HostName 203.0.113.10
User root
IdentityFile ~/.ssh/id_ed25519

Then connect with ssh my-server.