Secure a Linux server

Update it, add your own user and sign in with a key.

Update everything

On Ubuntu or Debian, as root or with sudo:

sudo apt update && sudo apt upgrade

On Rocky Linux, AlmaLinux, Fedora, Oracle Linux or CentOS Stream:

sudo dnf upgrade

Add your own user

On Ubuntu or Debian:

sudo adduser yourname
sudo usermod -aG sudo yourname

On the dnf systems, use the wheel group in place of sudo, and set a password with passwd.

Sign in with a key

Follow Connect with SSH. Test the key in a second window before you turn off password sign-in, so you cannot lock yourself out.

Make your own backups

Keep copies of important files somewhere other than the server.