First login to a VPS and basic hardening
Six steps to take before you deploy anything to the server.
Updated: August 13, 2026 · 1 min read
Once the server is created you receive its IP address and the password for the root account.
1. Sign in
ssh root@IP_ADDRESS
2. Update the system
apt update && apt upgrade -y # Debian, Ubuntu
dnf upgrade -y # AlmaLinux, Rocky
3. Create an ordinary user
Working as root permanently is a needless risk.
adduser yourname
usermod -aG sudo yourname # on AlmaLinux/Rocky: -aG wheel
4. Set up key-based login
From your own machine:
ssh-copy-id yourname@IP_ADDRESS
Then, in /etc/ssh/sshd_config, turn off password login and direct root login:
PasswordAuthentication no
PermitRootLogin no
Apply the change with systemctl restart sshd. Before you log out, open a second connection and confirm that key-based login works - otherwise you will lock yourself out of the server.
5. Turn on the firewall
ufw allow OpenSSH && ufw enable # Debian, Ubuntu
6. Sort out your backups
We do not back up VPS or dedicated servers. Backing them up is entirely the customer’s responsibility. Set it up before you deploy anything to the server that you would not want to lose.
Snapshots, if your service includes them, are good for reverting quickly before a change, but they are not a substitute for a backup held off the server.
Cannot find what you need, or a step does not match what you see?
Go to the helpdesk