A VPS is fully under your control, which also means keeping it secure is your responsibility.
1. Use SSH keys
Create a key pair on your computer (ssh-keygen -t ed25519), copy the public key to the server (ssh-copy-id root@your.server.ip), then turn off password sign-in by setting PasswordAuthentication no in /etc/ssh/sshd_config and restarting SSH.
2. Create a normal user
Sign in as a normal user with sudo rights instead of root, and set PermitRootLogin no once that works.
3. Turn on a firewall
Only allow the ports you need — for example SSH (22), HTTP (80) and HTTPS (443). Use ufw on Ubuntu or firewalld on AlmaLinux/Rocky.
4. Block repeated login attempts
Install fail2ban to ban addresses that keep guessing passwords.
5. Keep it updated
Install security updates regularly, or turn on automatic security updates.
6. Back it up
Take regular backups or snapshots and keep a copy elsewhere.