OPS/VPS security basics.md
VPS security basics
Last update: 2024-11-29
Status: draft
This is a short list of things to take into account to have some basic security in a VPS.
Regular system updates
- Use
sudo apt update && sudo apt upgrade
regularly to fetch and apply updates. - For kernel updates, use
sudo apt full-upgrade
to ensure all packages are updated. - Clean up with
sudo apt autoremove
to remove unnecessary packages.
Enable unattended upgrades
Used for ensuring your Ubuntu server automatically installs security updates without manual intervention.
Install with unattended-upgrades
.
sudo apt install unattended-upgrades
Configure by editing /etc/apt/apt.conf.d/50unattended-upgrades
to suit your needs.
To check if it’s working
You can check the timestamp files.
ls -l /var/lib/apt/periodic/
Or manually run a test:
sudo unattended-upgrade --dry-run --debug
Logs are located at /var/log/unattended-upgrades/
.