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:
- Open a terminal.
- Run the following command, replacing the email address with your own:
- ssh-keygen -t ed25519 -C "your@email.com"
- When prompted for a file location, press Enter to accept the default (~/.ssh/id_ed25519).
- Optionally enter a passphrase for extra security, then press Enter.
- 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:
- Open Windows Terminal or PowerShell and run ssh-keygen -t ed25519. This works on Windows 10 version 1809 and later.
- 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
- Log in to the Virtualizor Enduser Panel.
- In the sidebar, click SSH Keys.
- Click Add SSH Key.
- 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.
- Give the key a descriptive name (e.g. My Laptop).
- Click Save.
Step 3 — Apply the SSH key to a VPS
- Still in the SSH Keys section, find the key you just added.
- Click the Apply button next to the key.
- A list of your VPS instances will appear. Select the VPS to which you want to add this key.
- 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.