What is an SSH key?
SSH, the secure shell, is how you reach a Linux or FreeBSD server from a terminal. It can check who you are with a password or with a key pair. The private half never leaves your laptop; the public half is copied to the server's ~/.ssh/authorized_keys file. When you connect, the server sends a challenge that only the matching private key can sign. Nothing secret crosses the network, there is no password to guess, and a key of 256 bits of strength is far beyond the reach of brute force.
Why use keys on a dedicated server?
A public IPv4 address receives automated login attempts within minutes of going online; it is background noise on the internet, not a sign of a targeted attack. Password logins turn every one of those attempts into a guess against your root account. With key-only login the guesses fail immediately, the logs stay quiet, and the strength of your access no longer depends on someone remembering a long password.
How do I create a key?
On Linux, macOS and current Windows 10 and 11, the OpenSSH client is already installed. ed25519 is the modern default: short keys, fast, and strong.
ssh-keygen -a 100 -t ed25519 -f ~/.ssh/cheapdedicated_key -C "office-pc" # Enter a passphrase when asked; it encrypts the private key on disk cat ~/.ssh/cheapdedicated_key.pub # this single line is your public key
The public key is one line starting with ssh-ed25519. That line is safe to paste anywhere. The private file ~/.ssh/cheapdedicated_key is the one to protect: never paste it into a ticket, a chat or a form.
| Key type | Public key length | Notes |
|---|---|---|
| ed25519 | about 80 characters | Recommended default, fast and compact |
| RSA 4096 | about 730 characters | Works with very old clients |
| ECDSA P-256 | about 160 characters | Fine, less common for servers |
How do I get the key onto a CheapDedicated machine?
The easiest path is before you order. In the panel open SSH keys, paste the public line and give it a name. When you order a machine, tick the keys you want, and they are placed for root during installation. The first login then needs no password at all:
ssh root@SERVER_ADDRESS
If you order without a key, the machine is installed with a random root password shown in the panel once the machine reports Powered on. Log in with it once and add your key straight away:
ssh-copy-id -i ~/.ssh/cheapdedicated_key.pub root@SERVER_ADDRESS
A reinstall from the panel wipes the disks and sets things up fresh, so keep your keys saved in the panel to have them placed again.
How do I turn off password logins?
After you have confirmed that the key works in a second terminal, disable passwords so only keys are accepted:
# keys only: a drop-in file is read before the main sshd_config cd /etc/ssh/sshd_config.d echo "PasswordAuthentication no" > 20-keys-only.conf echo "KbdInteractiveAuthentication no" >> 20-keys-only.conf echo "PermitRootLogin prohibit-password" >> 20-keys-only.conf systemctl reload ssh # Debian / Ubuntu systemctl reload sshd # AlmaLinux / Rocky / CentOS Stream
Keep the first session open while you test a new connection from another window. If something is off, you can still fix it from the session that is already logged in.
Can I log in from more than one device?
Each computer gets its own key pair, and each public line goes on its own row in authorized_keys. A short entry in ~/.ssh/config on your laptop saves typing the address every time:
Host box1
HostName SERVER_ADDRESS
User root
IdentityFile ~/.ssh/cheapdedicated_key
After that, ssh box1 is enough, and tools built on SSH such as rsync, scp and Git use the same entry.
Good habits with keys
- One key per device. If a laptop is lost, delete just its line from
authorized_keys. - Use a passphrase and an agent (
ssh-agent, or the agent built into your password manager) so the key is encrypted at rest but you type the passphrase once per session. - Create a normal user with sudo for daily work and keep root for setup.
- Back up the private key in a safe place. If it is lost and passwords are off, the way back is a reinstall from the panel.
- Add a simple firewall that allows SSH, plus the ports your service needs, and drops the rest.
Keys work the same on every machine in the list, from the E1 at $30.52 a month to the largest High memory line boxes, on all nine images, Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS Stream, Proxmox VE and FreeBSD alike.
Keep Reading
IPv4 on a /31
Why each machine gets one public IPv4 on a /31 network, how the two addresses split between gateway and server, and how to configure it.
OpenEdge DDoS filtering
How common volumetric attacks are filtered at the network edge before they reach your ports, and what you still handle on the box.
OpenTwo-drive mirror (RAID 1)
How RAID 1 keeps a full copy of your data on two drives, which machines have two drives and how to check it with mdadm.
OpenFAQ
Quick Answers
Yes. Add the public key under SSH keys in the panel and tick it when you order; it is placed for root at install time.
The machine gets a random root password, shown in the panel once it is Powered on. Log in once and add your key.
ed25519. It is the modern default in OpenSSH: short, fast and strong.
Yes. The public key line can be pasted anywhere. Never share the private key file.
If password login is disabled, reinstall the machine from the panel with a new key. A reinstall wipes the disks, so keep backups.