Quick answer
How to set up SSH keys on a VPS?
To set up SSH keys on a VPS, run ssh-keygen -t ed25519 on your computer, copy the one-line .pub file to the server, log in with the key, then set PasswordAuthentication no. At IronKVM you can paste the public key at checkout, so the server is delivered with password login already off, within 1 hour.
In brief
- Ubuntu documentation recommends Ed25519 keys; RSA with 4096 bits is the fallback.
- Only the line from the .pub file goes to the server; the private key never leaves your computer.
- Root over SSH. Paste a public key at checkout and password login stays off; leave it empty and the team sets a temporary root password, shown in the dashboard, to change at first login.
- Test the key in a second terminal before you turn password login off.
- Check the config with sshd -t before restarting the service.
Which file does what in SSH key login?
| File | Where | Role |
|---|---|---|
| ~/.ssh/id_ed25519 | Your computer | Private key: keep it secret |
| ~/.ssh/id_ed25519.pub | Your computer | Public key: the line you paste |
| ~/.ssh/authorized_keys | The VPS, in the user’s home | List of public keys allowed to log in |
| /etc/ssh/sshd_config.d/*.conf | The VPS | Drop-in settings read before the main file |
| /etc/ssh/sshd_config | The VPS | Main SSH server settings |
What are the steps to set up SSH keys on a VPS?
Create the key pair
On Linux, macOS or Windows PowerShell, run ssh-keygen -t ed25519 and press Enter to accept the defaults. Add a passphrase if you want one.
Show the public key
Print the .pub file and copy the whole line. It starts with ssh-ed25519.
Give the key to the server
Paste it at checkout, or on a running server use ssh-copy-id user@VPS_IP.
Log in with the key
Run ssh root@VPS_IP or ssh user@VPS_IP. No password prompt should appear.
Turn password login off
Create a drop-in file with PasswordAuthentication no and KbdInteractiveAuthentication no.
Test and restart
Run sshd -t, restart the ssh service, and open a new session before closing the old one.
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pub
# on a server that already runs, copy the key over
ssh-copy-id root@VPS_IPHow do you add the key at the IronKVM checkout?
Paste the .pub line in the “SSH public key” field before paying. The checkout accepts one line that starts with ssh-ed25519, ssh-rsa or ecdsa-sha2. With a key, password login stays off and only your key opens root. The checkout also shows the ssh-keygen command for each system.
No key? Leave the field empty. A team member then sets a temporary root password, shown in the dashboard. Log in, run passwd, then add your key as below. If you reinstall later, the reinstall dialog has a “New SSH public key” field; leave it empty to keep the key from the order. The first SSH login guide covers both cases.
mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo 'ssh-ed25519 AAAA... you@laptop' >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keysHow do you turn password login off safely?
Put the settings in a drop-in file, test the syntax, and keep one session open while you test. Ubuntu documentation explains that the main sshd_config includes /etc/ssh/sshd_config.d/*.conf at the very top. OpenSSH keeps the first value it reads for most settings, so a file named 00-… wins over later ones.
The OpenSSH manual says PasswordAuthentication and KbdInteractiveAuthentication both default to yes, and PermitRootLogin defaults to prohibit-password. That default already blocks root passwords but allows root keys. If you work as a normal user with sudo, set PermitRootLogin no as well. Then run sshd -t: it prints nothing when the file is valid.
# write the drop-in file
sudo tee /etc/ssh/sshd_config.d/00-keys-only.conf <<'EOF'
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
EOF
sudo sshd -t
sudo systemctl restart ssh.serviceWhat does a VPS with key-only root access cost?
Every IronKVM plan includes root over SSH; the price depends on size, not on access. Billet costs $4.46 a month on 12 months and Ingot $8.25. According to IronKVM's survey of 16 November 2026, plans comparable to Ingot cost a median of $25.49 a month across 20 hosts.
After keys, the next steps are a firewall and ban rules. The offshore VPS security guide puts them in order, and how to install fail2ban blocks addresses that keep guessing.
SSH keys on a VPS: questions
Which SSH key type is best in 2026?
Ed25519. Ubuntu documentation recommends it for its short keys and low computing cost; RSA 4096 is the fallback for old systems.
I lost my private key. What now?
Nobody can recover it. Request a reinstall from the dashboard with a new public key; a reinstall wipes the disk.
Can I use one key for several servers?
Yes. The same public key can sit in authorized_keys on any number of servers.
Should I add a passphrase?
Yes if the computer could be lost or shared. ssh-agent keeps typing to once per session.
Does IronKVM ever ask for my private key?
No. The dashboard says it plainly: keep the private key safe, it is never asked for.
Verdict
- Create an Ed25519 key and paste it at checkout: the IronKVM server then arrives with password login off.
- On a server that already runs, add the key, test it, then set PasswordAuthentication no in a drop-in file and check it with sshd -t.
Sources (4)
- OpenSSH server — Canonical (read 2026-11-16)
- sshd_config(5) — OpenBSD (read 2026-11-16)
- IronKVM client area: checkout and server screens (vpshost module) — IronKVM (read 2026-11-16)
- IronKVM offshore VPS survey (CSV) — IronKVM (read 2026-11-16)
Order a VPS with your SSH key
Paste your key at checkout. Ingot, 2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB traffic, $8.25 a month on 12 months.