Linux VPS

Log in with SSH keys and disable passwords

Create an SSH key pair, install it on the server and turn off password logins. · 4 min read

SSH keys are much more secure than passwords and stop brute-force attacks.

1. Create a key on your computer

ssh-keygen -t ed25519 -C "you@example.com"

Press Enter to accept the default path and set a passphrase.

2. Copy the key to the server

ssh-copy-id root@YOUR_SERVER_IP

On Windows without ssh-copy-id:

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

3. Test the login

ssh root@YOUR_SERVER_IP

You should log in without the server password.

4. Disable password login

sudo nano /etc/ssh/sshd_config
# set:
PasswordAuthentication no
PermitRootLogin prohibit-password
sudo systemctl restart ssh

Keep your current session open and test a new login before closing it.

Order a server built by real engineers or talk to our team — we are online 24/7. Support →

Linux VPS

All tutorials

Ready to launch your project?

Order a server built by real engineers or talk to our team — we are online 24/7.