Install and enable
sudo apt update
sudo apt install unattended-upgrades apt-listchanges
sudo dpkg-reconfigure -plow unattended-upgrades
Choose to download and install updates automatically when the dialog asks.
What to allow
Primary config: /etc/apt/apt.conf.d/50unattended-upgrades. For a typical internet-facing 22.04 server, keep at least:
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
};
Enable the timer path via /etc/apt/apt.conf.d/20auto-upgrades:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
Verify
systemctl status unattended-upgrades
sudo unattended-upgrade --dry-run --debug
grep -E 'unattended|upgrade' /var/log/unattended-upgrades/unattended-upgrades.log | tail
After updates: still prove the job
Updates can bring packages back or change behavior. A monthly Inaabi Tune re-run on your staging copy after Ubuntu updates, re-running your acceptance test, is coming. DIY operators should reboot when /var/run/reboot-required appears, then re-run their own test.
Related guides: SSH hardening on Ubuntu 22.04 · removing unused packages · harden without breaking it.
FAQ
Will automatic updates reboot my server?
Unattended-upgrades can install packages without rebooting. Kernel updates often need a reboot you schedule. Check /var/run/reboot-required.
Is this enough hardening by itself?
No. Updates close known holes in what you already installed. Removal and SSH/firewall settings are separate jobs.
Does Tune touch this?
Tune checks that automatic security updates are on, turns them on if they are not, and leaves them on. A monthly re-run after updates is coming.
Next
Free baseline: Inaabi Scan. Product: Subscribe to Inaabi Tune at $20 per server per month. More guides: all Inaabi guides.
MinakiLabs