Skip to content
Happy New Year 2027 from ZenexCloud
ZenexCloud
VPS

How do I set up SSH keys on my VPS?

Create an SSH key pair, add it to your server and turn off password login.

SSH keys are safer than passwords. You keep a private key on your computer and put the public key on the server.

Create a key (on your computer)

  1. Open a terminal.
  2. Run: ssh-keygen -t ed25519 -C "you@example.com"
  3. Press Enter to save in the default place. Set a passphrase.
  4. Your public key is in ~/.ssh/id_ed25519.pub. Never share the file without .pub.

Add the key to the server

  • Easy way: ssh-copy-id root@YOUR_SERVER_IP
  • Manual way: log in, then run mkdir -p ~/.ssh and paste the contents of the .pub file into ~/.ssh/authorized_keys. Set permissions: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys.
  • If the VirtFusion panel lets you save an SSH key, you can add it there for new installs or reinstalls.

Test Open a second terminal and run ssh root@YOUR_SERVER_IP. It should not ask for the account password (it may ask for the key passphrase).

Turn off password login

  1. Edit /etc/ssh/sshd_config.
  2. Set PasswordAuthentication no.
  3. Restart SSH: systemctl restart sshd (or ssh).

Keep your first session open until you confirm the key works.

Lost your key? Use the console in the VPS panel to log in with a password and add a new key.

Still need help?

Ask Zeni in the chat bubble, or open a support ticket. We answer 24/7.