How to Add and Apply SSH Keys in Virtualizor

Knowledgebase / How to Add and Apply SSH Keys in Virtualizor

How to Add and Apply SSH Keys in Virtualizor

0 found helpful (0 votes) ...
Back to Knowledgebase

SSH keys provide a more secure method of authenticating to your VPS than passwords. Instead of typing a password each time you connect, your SSH client uses a cryptographic key pair — a private key that stays on your computer and a public key that is placed on the server. Virtualizor lets you upload and apply SSH public keys to your VPS directly from the control panel.


Step 1 — Generate an SSH key pair (if you do not already have one)

If you already have an SSH key pair, skip to Step 2.

Linux and macOS:

  1. Open a terminal.
  2. Run the following command, replacing the email address with your own:
    • ssh-keygen -t ed25519 -C "your@email.com"
  3. When prompted for a file location, press Enter to accept the default (~/.ssh/id_ed25519).
  4. Optionally enter a passphrase for extra security, then press Enter.
  5. Two files are created: ~/.ssh/id_ed25519 (the private key — keep this secret) and ~/.ssh/id_ed25519.pub (the public key — this is what you upload to Virtualizor).

Windows:

  1. Open Windows Terminal or PowerShell and run ssh-keygen -t ed25519. This works on Windows 10 version 1809 and later.
  2. Alternatively, use PuTTYgen: open it, select EdDSA or RSA as the key type, click Generate, move the mouse to generate entropy, then click Save public key and Save private key.

Step 2 — Add the public key to Virtualizor

  1. Log in to the Virtualizor Enduser Panel.
  2. In the sidebar, click SSH Keys.
  3. Click Add SSH Key.
  4. In the Key field, paste the full contents of your public key file. Open the file in a text editor to copy it, or run cat ~/.ssh/id_ed25519.pub in a terminal and copy the output. The key starts with ssh-ed25519 or ssh-rsa and ends with your email address.
  5. Give the key a descriptive name (e.g. My Laptop).
  6. Click Save.

Step 3 — Apply the SSH key to a VPS

  1. Still in the SSH Keys section, find the key you just added.
  2. Click the Apply button next to the key.
  3. A list of your VPS instances will appear. Select the VPS to which you want to add this key.
  4. Click Apply. Virtualizor will write the public key to /root/.ssh/authorized_keys on the selected VPS.

How to connect to your VPS using the SSH key

  • Linux / macOS: open a terminal and run ssh root@your-vps-ip. SSH will automatically use your private key from ~/.ssh/.
  • Windows (Windows Terminal or PowerShell): run ssh root@your-vps-ip. The key in C:UsersYourUsername.ssh will be used automatically.
  • Windows (PuTTY): open PuTTY, enter your VPS IP in the Host Name field, go to Connection → SSH → Auth → Credentials, browse for your private key file (.ppk format), then click Open.

Security reminder

  • Keep your private key file secure. Never share it, never upload it anywhere, and never paste it into any web form.
  • If you believe your private key has been compromised, generate a new key pair immediately, add the new public key to Virtualizor and your VPS, then remove the old key from /root/.ssh/authorized_keys.

Troubleshooting

  • SSH still prompts for a password after applying the key: confirm the key was written to /root/.ssh/authorized_keys on the VPS by logging in once with your password and running cat /root/.ssh/authorized_keys. Also check that the permissions on the .ssh directory are 700 and on authorized_keys are 600.
  • Permission denied (publickey): ensure you are connecting as the correct user (root by default). Verify that PubkeyAuthentication yes is set in /etc/ssh/sshd_config on the VPS.

Was this article helpful?



Still need help?

Open a support ticket →

On This Page