← Help center · VPS and servers
How to set up SSH key login and turn off passwords
An SSH key is a long secret file on your computer. It is much harder to guess than a password.
1. Create a key (on your computer)
ssh-keygen -t ed25519
Press Enter to accept the default location. Add a passphrase.
2. Copy the public key to the server
ssh-copy-id root@YOUR-SERVER-IP
On Windows with PuTTY, use PuTTYgen to make the key and paste the public part into ~/.ssh/authorized_keys.
3. Test it
Open a new window and log in. It must work without the server password.
4. Turn off password login
Edit /etc/ssh/sshd_config and set:
PasswordAuthentication no
Then run systemctl restart ssh. Keep your first window open until you confirm the new login works.
More in VPS and servers
- How to connect to your Linux VPS with PuTTY (Windows)
- How to connect to a Linux VPS from Mac or Linux with SSH
- Where to find your server IP address and password
- How to change your root password on Linux
- First steps on a new Linux VPS: a security checklist
Still stuck? Open a support ticket.