Why SSH Keys?
SSH keys are more secure than passwords:Create SSH Key
- Windows
- macOS
- Linux
Windows 10/11 (PowerShell)
1
Open PowerShell
Press
Win + X and select Windows Terminal or PowerShell.2
Generate SSH Key
ED25519 is the most modern and secure algorithm. If your server doesn’t support it, use RSA:
3
Confirm Location
4
Set Passphrase (recommended)
5
Copy Public Key
ssh-ed25519).PuTTYgen (Alternative)
1
Open PuTTYgen
Install PuTTY and open PuTTYgen.
2
Generate Key
- Select EdDSA (or RSA with 4096 bits)
- Click Generate
- Move your mouse in the empty area for randomness
3
Save Keys
- Save private key → Save as
.ppkfile - Copy the text in the upper field (Public Key)
Add Public Key to Server
Now you need to add your Public Key to the server.Method 1: ssh-copy-id (recommended)
The easiest way - works on macOS and Linux:Method 2: Manual Copy
1
Log in with Password
2
Create SSH Directory (if needed)
3
Add Public Key
YOUR-PUBLIC-KEY-HERE with the copied key (starts with ssh-ed25519 or ssh-rsa).4
Test Connection
Open a new terminal and connect:
If there’s no password prompt, the key works!
Disable Password Login
After successful key setup, you can disable password login:1
Edit SSH Configuration
2
Change Settings
Find and change these lines:
3
Restart SSH Service
4
Test in New Terminal
Open a new terminal (keep the old one open!) and test:If it works, you can close the old terminal.
Manage Multiple Keys
SSH Config File
For multiple servers with different keys, create~/.ssh/config:
Troubleshooting
Permission denied (publickey)
Permission denied (publickey)
Possible causes:
- Public key not copied correctly
- Wrong permissions on server
- Wrong key being used
Agent has no identities
Agent has no identities
The SSH agent has no key loaded.Solution:
Key not accepted
Key not accepted
Check on server:The key must be on a single line and start with
ssh-ed25519 or ssh-rsa.Forgot passphrase
Forgot passphrase
Unfortunately, the passphrase cannot be recovered.Solution:
- Generate a new key
- Add the new public key to the server
- Delete the old key
Best Practices
🔐 Use a Passphrase
A passphrase protects your key if someone gains access to your computer.
🔄 Rotate Keys
Regularly create new keys and remove old ones from authorized_keys.
💾 Backup
Back up your private key in a secure location. Without it, you’ll lose access!
🚫 Never Share
Never share your private key. Only the public key is copied to servers.
Next Steps
Configure Firewall
Protect your server with firewall rules
API Reference
Automate with our REST API