How do you create an SSH key for a VPS?
Straight answer
To create an SSH key, open a terminal on Linux or macOS, or PowerShell on Windows, and run ssh-keygen -t ed25519. Press Enter to keep the default file, set a passphrase, then copy the 1-line .pub file. At BuyMoneroVPS you paste that line in the checkout's Access step, and root then logs in with the key only, never a password.
In brief
- The same command, ssh-keygen -t ed25519, works on Linux, macOS and Windows 10 (build 1809 or later) or 11.
- Two files appear: id_ed25519 (private, stays on your computer) and id_ed25519.pub (public, the one you paste).
- A lost passphrase cannot be recovered: you would have to make a new key.
- The BuyMoneroVPS checkout accepts one line starting with ssh-ed25519, ssh-rsa or ecdsa-sha2.
Why use an SSH key instead of a password?
A key cannot be guessed, and with a key at checkout the server never accepts a password for root. A password, however long, can be tried over and over by bots that scan every IPv4 address. A key pair works differently: the server holds the public half, your computer holds the private half, and the login succeeds only when both match. Microsoft's OpenSSH documentation describes the private key file as the equivalent of a password, to be protected the same way.
At BuyMoneroVPS the key is optional. Without one, a person sets a temporary root password and shows it in the dashboard; the SSH key or root password help page compares both options. With a key, password login stays off from the first boot, and the guide to disabling SSH password login is not needed.
How do you create the key, step by step?
Open a terminal
Linux: any terminal. macOS: Terminal in Applications > Utilities. Windows 10 or 11: PowerShell. If ssh-keygen is not found, add "OpenSSH Client" under Settings > Optional features.
Run ssh-keygen with the ed25519 type
Type ssh-keygen -t ed25519 -C "vps-2026". The comment after -C is only a label that helps you recognise the key later.
Accept the default file
Press Enter at "Enter file in which to save the key". The key goes to ~/.ssh/id_ed25519 on Linux and macOS, or C:\Users\you\.ssh\id_ed25519 on Windows.
Set a passphrase
Type a passphrase twice. It encrypts the private key on disk; an empty one works but leaves the file usable by anyone who copies it.
Show the public key
Print the .pub file and copy the whole line, from ssh-ed25519 to the comment at the end. It is one line, with no line breaks.
Paste it at checkout
In the Access step of the BuyMoneroVPS checkout, paste the line under "SSH public key". The page reads it as you type and shows "ed25519 SSH key ready" when it is valid.
ssh-keygen -t ed25519 -C "vps-2026"
# print the public key, then copy the whole line
cat ~/.ssh/id_ed25519.pub
# macOS: copy it straight to the clipboard
pbcopy < ~/.ssh/id_ed25519.pub
# check the fingerprint
ssh-keygen -lf ~/.ssh/id_ed25519.pubssh-keygen -t ed25519 -C "vps-2026"
# print the public key, or send it to the clipboard
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
# optional, in an elevated PowerShell: keep the key in ssh-agent
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519Which file is which, on each system?
| System | Where you run it | Private key (keep) | Public key (paste) |
|---|---|---|---|
| Linux | Terminal | ~/.ssh/id_ed25519 | ~/.ssh/id_ed25519.pub |
| macOS | Terminal | ~/.ssh/id_ed25519 | ~/.ssh/id_ed25519.pub |
| Windows 10 / 11 | PowerShell | C:\Users\you\.ssh\id_ed25519 | C:\Users\you\.ssh\id_ed25519.pub |
Why ed25519 rather than RSA?
Ed25519 is the default type of current OpenSSH, with short keys and fast signatures. The OpenBSD manual for ssh-keygen says the program creates an Ed25519 key when run with no type at all, and Microsoft's documentation for Windows says the same. The public key fits on one short line, which makes it easy to paste without breaking it.
RSA still works, and the BuyMoneroVPS checkout accepts ssh-rsa and ecdsa-sha2 lines too. Use RSA only if an older tool you rely on cannot read ed25519 keys. Whatever the type, the rule is the same: paste the .pub line, never the file without an extension, which is the private key.
What if you lose the key or want to add another?
Keep a copy of the private key and its passphrase: nobody, BuyMoneroVPS included, can recover either. The ssh-keygen manual states that a lost passphrase cannot be recovered; a new pair is then the only way. The server page says the same of the key itself: the team never asks for it and cannot rebuild it.
To add a second key, for a laptop for example, append its .pub line to /root/.ssh/authorized_keys on the server, or run ssh-copy-id from a machine that can already log in. If every key is lost, ask for a reinstall from the dashboard and paste a new public key in the "New SSH public key" field; the reinstall erases the disk, so it is a last resort.
According to BuyMoneroVPS's survey of 30 November 2026, the 2 vCPU / 4 GB size costs $9.12 here against a $18.98 mean elsewhere. With the key ready, the full order walkthrough takes you from checkout to first login, and how to secure a new Linux VPS covers the next ten minutes.
ssh -i ~/.ssh/id_ed25519 [email protected]
# add a second key from a machine that already logs in
ssh-copy-id -i ~/.ssh/laptop_ed25519.pub [email protected]Frequently asked questions
Do I need PuTTY on Windows?
No. Windows 10 (build 1809 or later) and 11 offer the OpenSSH Client as an optional feature, so ssh-keygen and ssh run in PowerShell. PuTTY uses its own key format; if you prefer it, export the public key in OpenSSH format before pasting it.
The checkout says my key is not valid. Why?
The field wants one line starting with ssh-ed25519, ssh-rsa or ecdsa-sha2. The usual causes are a line break added while copying, a missing first word, or the private key pasted by mistake.
Can I use the same key for several servers?
Yes. One public key can sit on any number of servers. Protect the private key with a passphrase, because whoever holds it can log in to all of them.
Can I add a key after ordering without one?
Yes. Log in with the temporary root password, add your .pub line to /root/.ssh/authorized_keys, test a key login, then switch password login off.
Verdict
- One command, ssh-keygen -t ed25519, gives you a key on every desktop system.
- Paste only the .pub line; keep the private key and its passphrase backed up.
- A key at checkout means no root password ever exists on the server.
Sources (4)
- ssh-keygen(1) manual page — OpenBSD (read 2026-11-30)
- Key-based authentication in OpenSSH for Windows — Microsoft Learn (read 2026-11-30)
- Get started with OpenSSH for Windows — Microsoft Learn (read 2026-11-30)
- OpenSSH server — Ubuntu Server documentation (read 2026-11-30)
Paste your key, get a server
Ring 1: 1 vCPU · 1 GB memory · 20 GB NVMe disk · 2 TB monthly transfer, root by SSH key, paid in Monero with no ID.