ServerHandbook live check: run log ------------------------------------------------------------------------------ Article https://serverhandbook.com/kb/unattended-upgrades-ubuntu Check scripts/live/checks/unattended-upgrades-ubuntu.mjs (sha256 c0a9c04e06f40fe86cc3c9e060d3f88b71bdd8beb257e24fe8d8db7578f34131) Ran at 2026-11-15T20:40:56Z (537 s) Result PASS, all 34 claims held Tested on System Ubuntu 24.04.5 LTS Kernel 6.8.0-149-generic Package unattended-upgrades 2.9.1+nmu4ubuntu1 Package apt 2.8.4ubuntu0.1 Package linux-image-virtual 6.8.0-149.149 Setup A fresh Ubuntu 24.04 server from Ubuntu’s cloud image, with the updates published since the image was built still waiting, reached over SSH as a sudo user. Every version above was read from the server at run time. Passwords used on the throwaway test server are shown as [password]. How we test: https://serverhandbook.com/how-we-test ------------------------------------------------------------------------------ What the steps changed on the server (recorded before the first step and after the last) Packages added (6) linux-headers-6.8.0-149 6.8.0-149.149 linux-headers-6.8.0-149-generic 6.8.0-149.149 linux-image-6.8.0-149-generic 6.8.0-149.149 linux-modules-6.8.0-149-generic 6.8.0-149.149 linux-tools-6.8.0-149 6.8.0-149.149 linux-tools-6.8.0-149-generic 6.8.0-149.149 Packages upgraded (48) apt 2.8.3 -> 2.8.4ubuntu0.1 apt-utils 2.8.3 -> 2.8.4ubuntu0.1 bind9-dnsutils 1:9.18.39-0ubuntu0.24.04.8 -> 1:9.18.39-0ubuntu0.24.04.9 bind9-host 1:9.18.39-0ubuntu0.24.04.8 -> 1:9.18.39-0ubuntu0.24.04.9 bind9-libs 1:9.18.39-0ubuntu0.24.04.8 -> 1:9.18.39-0ubuntu0.24.04.9 ca-certificates 20260601~24.04.1 -> 20260816ubuntu0.24.04.2 cloud-init 26.1-0ubuntu1~24.04.1 -> 26.2-0ubuntu1~24.04.2 distro-info 1.7build1 -> 1.7ubuntu0.1 distro-info-data 0.72-0ubuntu0.24.04.1 -> 2026.10.12-0ubuntu0.24.04.1 gir1.2-glib-2.0 2.80.0-6ubuntu3.9 -> 2.80.0-6ubuntu3.10 git 1:2.43.0-1ubuntu7.3 -> 1:2.43.0-1ubuntu7.4 git-man 1:2.43.0-1ubuntu7.3 -> 1:2.43.0-1ubuntu7.4 libapt-pkg6.0t64 2.8.3 -> 2.8.4ubuntu0.1 libbrotli1 1.1.0-2build2 -> 1.1.0-2ubuntu0.1 libc-bin 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 libc-dev-bin 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 libc-devtools 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 libc6 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 libc6-dev 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 libglib2.0-0t64 2.80.0-6ubuntu3.9 -> 2.80.0-6ubuntu3.10 libglib2.0-bin 2.80.0-6ubuntu3.9 -> 2.80.0-6ubuntu3.10 libglib2.0-data 2.80.0-6ubuntu3.9 -> 2.80.0-6ubuntu3.10 liblzma5 5.6.1+really5.4.5-1ubuntu0.3 -> 5.6.1+really5.4.5-1ubuntu0.4 libmspack0t64 0.11-1.1build1 -> 0.11-1.1ubuntu0.24.04.1 libnss3 2:3.98-1ubuntu0.2 -> 2:3.98-1ubuntu0.3 libpcre2-8-0 10.42-4ubuntu2.1 -> 10.42-4ubuntu2.2 libperl5.38t64 5.38.2-3.2ubuntu0.6 -> 5.38.2-3.2ubuntu0.7 libsqlite3-0 3.45.1-1ubuntu2.8 -> 3.45.1-1ubuntu2.9 linux-headers-generic 6.8.0-147.147 -> 6.8.0-149.149 linux-headers-virtual 6.8.0-147.147 -> 6.8.0-149.149 linux-image-virtual 6.8.0-147.147 -> 6.8.0-149.149 linux-libc-dev 6.8.0-147.147 -> 6.8.0-149.149 linux-tools-common 6.8.0-147.147 -> 6.8.0-149.149 linux-virtual 6.8.0-147.147 -> 6.8.0-149.149 locales 2.39-0ubuntu8.9 -> 2.39-0ubuntu8.12 perl 5.38.2-3.2ubuntu0.6 -> 5.38.2-3.2ubuntu0.7 perl-base 5.38.2-3.2ubuntu0.6 -> 5.38.2-3.2ubuntu0.7 perl-modules-5.38 5.38.2-3.2ubuntu0.6 -> 5.38.2-3.2ubuntu0.7 python3-distro-info 1.7build1 -> 1.7ubuntu0.1 python3-jwt 2.7.0-1ubuntu0.3 -> 2.7.0-1ubuntu0.4 python3-pyasn1 0.4.8-4ubuntu0.3 -> 0.4.8-4ubuntu0.4 python3-twisted 24.3.0-1ubuntu0.2 -> 24.3.0-1ubuntu0.3 snapd 2.77.1+ubuntu24.04 -> 2.78+ubuntu24.04 tmux 3.4-1ubuntu0.1 -> 3.4-1ubuntu0.2 ubuntu-pro-client 37.2ubuntu~24.04.1 -> 38ubuntu0~24.04 ubuntu-pro-client-l10n 37.2ubuntu~24.04.1 -> 38ubuntu0~24.04 xz-utils 5.6.1+really5.4.5-1ubuntu0.3 -> 5.6.1+really5.4.5-1ubuntu0.4 zlib1g 1:1.3.dfsg-3.1ubuntu2.2 -> 1:1.3.dfsg-3.1ubuntu2.3 Packages removed (0) Services enabled at boot (0) Services disabled (0) Listening sockets opened (0) Listening sockets closed (0) Files added in /etc (10) /etc/apt/apt.conf.d/52unattended-upgrades-local /etc/ssl/certs/36c6b318.0 /etc/ssl/certs/422cf4bf.0 /etc/ssl/certs/9cd9d94b.0 /etc/ssl/certs/SECOM_TLS_ECC_Root_CA_2024.pem /etc/ssl/certs/SECOM_TLS_RSA_Root_CA_2024.pem /etc/ssl/certs/Telia_EC_TLS_Root_CA_v3.pem /etc/ssl/certs/Telia_RSA_TLS_Root_CA_v3.pem /etc/ssl/certs/faf4fe6b.0 /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf Files changed in /etc (9) /etc/apparmor.d/ubuntu_pro_esm_cache /etc/ca-certificates.conf /etc/ca-certificates.conf.dpkg-old /etc/cloud/templates/hosts.azurelinux.tmpl /etc/cloud/templates/sources.list.debian.tmpl /etc/ld.so.cache /etc/profile.d/Z99-cloud-locale-test.sh /etc/profile.d/Z99-cloudinit-warnings.sh /etc/ssl/certs/ca-certificates.crt Files removed from /etc (10) /etc/ssl/certs/14bc7599.0 /etc/ssl/certs/616816f6.0 /etc/ssl/certs/6b99d060.0 /etc/ssl/certs/Atos_TrustedRoot_2011.pem /etc/ssl/certs/Entrust_Root_Certification_Authority.pem /etc/ssl/certs/SecureSign_Root_CA12.pem /etc/ssl/certs/ca6e4ad9.0 /etc/ssl/certs/e36a6752.0 /etc/ssl/certs/ePKI_Root_Certification_Authority.pem /etc/ssl/certs/emSign_ECC_Root_CA_-_G3.pem Disk used on / (includes logs written during the run): +186.1 MB ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Audit: Lynis 3.1.7, the whole server, before the first step and after the last ------------------------------------------------------------------------------ Hardening index 62 -> 67 (Lynis's own score for this server; not a certification) Warnings 2 -> 1 Suggestions 41 -> 40 Resolved by the steps (2) PKGS-7392 Update your system with apt-get update, apt-get upgrade, apt-get dist-upgrade and/or unattended-upgrades PKGS-7392 Found one or more vulnerable packages. New after the steps (0) ------------------------------------------------------------------------------ Claims (34), each with what the run saw ------------------------------------------------------------------------------ 1. ok a bare Ubuntu 24.04 server box (web-server) starts 2. ok unattended-upgrades is installed on a fresh server | unattended-upgrades 2.9.1+nmu4ubuntu1 installed 3. ok 20auto-upgrades already turns on the daily list update and the daily upgrade | APT::Periodic::Update-Package-Lists "1"; | APT::Periodic::Unattended-Upgrade "1"; 4. ok two timers drive it: apt-daily (lists) and apt-daily-upgrade (install) | NEXT LEFT LAST PASSED UNIT ACTIVATES | Mon 2026-11-16 06:24:09 UTC 9h - - apt-daily-upgrade.timer apt-daily-upgrade.service | Mon 2026-11-16 16:18:20 UTC 19h - - apt-daily.timer apt-daily.service | | 2 timers listed. | Pass --all to see loaded but inactive timers, too. 5. ok the install timer runs at 6:00 plus up to 60 minutes at random, and catches up after downtime | # /usr/lib/systemd/system/apt-daily-upgrade.timer | [Unit] | Description=Daily apt upgrade and clean activities | After=apt-daily.timer | | [Timer] | OnCalendar=*-*-* 6:00 | RandomizedDelaySec=60m | Persistent=true | | [Install] | WantedBy=timers.target 6. ok the server clock is UTC, so 6:00 means 6:00 UTC | Timezone=Etc/UTC 7. ok it takes packages from the release and -security pockets only (and Ubuntu Pro ESM) | Unattended-Upgrade::Allowed-Origins ""; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security"; 8. ok a new server has security updates waiting | 36 9. ok the newer kernel is waiting, and is a security update too (noble-updates and -security) | linux-image-virtual/noble-updates,noble-security 6.8.0-149.149 amd64 [upgradable from: 6.8.0-147.147] 10. ok --dry-run -v lists what the next run will install, without installing (the kernel only when it is a security update) | Packages that will be upgraded: apt apt-utils bind9-dnsutils bind9-host bind9-libs ca-certificates distro-info-data git git-man libapt-pkg6.0t64 libbrotli1 libc-bin libc-dev-bin libc-devtools libc6 libc6-dev liblzma5 libmspack0t64 libnss3 libpcre2-8-0 libperl5.38t64 linux-headers-generic linux-headers-virtual linux-image-virtual linux-libc-dev linux-tools-common linux-virtual locales perl perl-base perl-modules-5.38 python3-jwt python3-pyasn1 python3-twisted xz-utils zlib1g 11. ok (the drop-in is exactly as the article shows it) | [Timer] | OnCalendar= | OnCalendar=*-*-* 03:00 | RandomizedDelaySec=15m 12. ok the next run is now between 03:00 and 03:15 | NEXT LEFT LAST PASSED UNIT ACTIVATES | Mon 2026-11-16 03:07:23 UTC 6h - - apt-daily-upgrade.timer apt-daily-upgrade.service | | 1 timers listed. | Pass --all to see loaded but inactive timers, too. 13. ok (the timer fired on its own at 20:45 UTC and its run finished) | 0= | > → 412015253 | > inactive 14. ok the journal shows the timer’s service ran and finished: "Finished apt-daily-upgrade.service" | Nov 15 20:47:50 web-server systemd[1]: apt-daily-upgrade.service: Deactivated successfully. | Nov 15 20:47:50 web-server systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities. | Nov 15 20:47:50 web-server systemd[1]: apt-daily-upgrade.service: Consumed 2min 30.900s CPU time, 1.0G memory peak, 0B memory swap peak. 15. ok its log lists the packages it upgraded and ends "All upgrades installed" | 2026-11-15 20:45:02,263 INFO Initial whitelist (not strict): | 2026-11-15 20:45:16,769 INFO Packages that will be upgraded: apt apt-utils bind9-dnsutils bind9-host bind9-libs ca-certificates distro-info-data git git-man libapt-pkg6.0t64 libbrotli1 libc-bin libc-dev-bin libc-devtools libc6 libc6-dev liblzma5 libmspack0t64 libnss3 libpcre2-8-0 libperl5.38t64 linux-headers-generic linux-headers-virtual linux-image-virtual linux-libc-dev linux-tools-common linux-virtual locales perl perl-base perl-modules-5.38 python3-jwt python3-pyasn1 python3-twisted xz-utils zlib1g | 2026-11-15 20:45:16,769 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log | 2026-11-15 20:47:50,123 INFO All upgrades installed 16. ok the log folder is not readable without sudo | ls: cannot open directory '/var/log/unattended-upgrades/': Permission denied 17. ok no security updates are left | 0 18. ok what it installed needs a reboot: /var/run/reboot-required is there, and nothing reboots by default | /var/run/reboot-required 19. ok starting the service again the same day does nothing: the log gets no new line | 18 → 18 20. ok …because /var/lib/apt/periodic/upgrade-stamp is dated today | -rw-r--r-- 1 root root 0 2026-11-15 /var/lib/apt/periodic/upgrade-stamp 21. ok (the 52unattended-upgrades-local file is exactly as the article shows it) | Unattended-Upgrade::Allowed-Origins { | "${distro_id}:${distro_codename}-updates"; | }; | Unattended-Upgrade::Automatic-Reboot "true"; | Unattended-Upgrade::Automatic-Reboot-Time "02:00"; 22. ok the new file ADDS -updates to the list; the default origins stay | Unattended-Upgrade::Allowed-Origins ""; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security"; | Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-updates"; 23. ok a run now installs the packages waiting in -updates | Packages that will be upgraded: cloud-init distro-info gir1.2-glib-2.0 libglib2.0-0t64 libglib2.0-bin libglib2.0-data libsqlite3-0 python3-distro-info snapd tmux ubuntu-pro-client ubuntu-pro-client-l10n | All upgrades installed | Found /var/run/reboot-required, rebooting | Shutdown msg: b"Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel." 24. ok …finds /var/run/reboot-required and schedules the reboot for 02:00 | Packages that will be upgraded: cloud-init distro-info gir1.2-glib-2.0 libglib2.0-0t64 libglib2.0-bin libglib2.0-data libsqlite3-0 python3-distro-info snapd tmux ubuntu-pro-client ubuntu-pro-client-l10n | All upgrades installed | Found /var/run/reboot-required, rebooting | Shutdown msg: b"Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel." 25. ok /var/run/reboot-required.pkgs names the new kernel | libc6 | linux-image-6.8.0-149-generic | linux-base 26. ok shutdown --show confirms the reboot waiting for 02:00 UTC | Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel. 27. ok until the reboot the server still runs the old kernel | 6.8.0-147-generic (new: 6.8.0-149-generic) 28. ok the server comes back after the reboot | 13 29. ok after the reboot it runs the new kernel | 6.8.0-149-generic 30. ok and /var/run/reboot-required is gone | ls: cannot access '/var/run/reboot-required': No such file or directory 31. ok the 03:00 time survives the reboot | NEXT LEFT LAST PASSED UNIT ACTIVATES | Mon 2026-11-16 03:03:35 UTC 6h Sun 2026-11-15 20:45:01 UTC - apt-daily-upgrade.timer apt-daily-upgrade.service | | 1 timers listed. | Pass --all to see loaded but inactive timers, too. 32. ok (tested on) the box reports its OS, kernel and the version of 3 package(s) | PRETTY_NAME="Ubuntu 24.04.5 LTS" | VIRT=none | KERNEL=6.8.0-149-generic | PKG apt 2.8.4ubuntu0.1 | PKG linux-image-virtual 6.8.0-149.149 | PKG unattended-upgrades 2.9.1+nmu4ubuntu1 33. ok Unattended-Upgrade "0" turns the daily install off | APT::Periodic::Unattended-Upgrade "0"; 34. ok (with "0" the timer’s service runs but does not upgrade: no new log line, even with no stamp) | 27 → 27 ------------------------------------------------------------------------------ Commands and what they printed (32) ------------------------------------------------------------------------------ $ dpkg-query -W -f='${Package} ${Version} ${db:Status-Status}\n' unattended-upgrades unattended-upgrades 2.9.1+nmu4ubuntu1 installed $ cat /etc/apt/apt.conf.d/20auto-upgrades APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; $ systemctl list-timers apt-daily.timer apt-daily-upgrade.timer --no-pager NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2026-11-16 06:24:09 UTC 9h - - apt-daily-upgrade.timer apt-daily-upgrade.service Mon 2026-11-16 16:18:20 UTC 19h - - apt-daily.timer apt-daily.service 2 timers listed. Pass --all to see loaded but inactive timers, too. $ systemctl cat apt-daily-upgrade.timer --no-pager # /usr/lib/systemd/system/apt-daily-upgrade.timer [Unit] Description=Daily apt upgrade and clean activities After=apt-daily.timer [Timer] OnCalendar=*-*-* 6:00 RandomizedDelaySec=60m Persistent=true [Install] WantedBy=timers.target $ timedatectl show -p Timezone Timezone=Etc/UTC $ apt-config dump Unattended-Upgrade::Allowed-Origins Unattended-Upgrade::Allowed-Origins ""; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security"; $ sudo apt update Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease Hit:2 http://archive.ubuntu.com/ubuntu noble-updates InRelease Hit:3 http://security.ubuntu.com/ubuntu noble-security InRelease Hit:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 48 packages can be upgraded. Run 'apt list --upgradable' to see them. $ apt list --upgradable 2>/dev/null | grep -c security 36 $ apt list --upgradable 2>/dev/null | grep linux-image linux-image-virtual/noble-updates,noble-security 6.8.0-149.149 amd64 [upgradable from: 6.8.0-147.147] $ sudo unattended-upgrade --dry-run -v 2>&1 | grep "Packages that will be upgraded" Packages that will be upgraded: apt apt-utils bind9-dnsutils bind9-host bind9-libs ca-certificates distro-info-data git git-man libapt-pkg6.0t64 libbrotli1 libc-bin libc-dev-bin libc-devtools libc6 libc6-dev liblzma5 libmspack0t64 libnss3 libpcre2-8-0 libperl5.38t64 linux-headers-generic linux-headers-virtual linux-image-virtual linux-libc-dev linux-tools-common linux-virtual locales perl perl-base perl-modules-5.38 python3-jwt python3-pyasn1 python3-twisted xz-utils zlib1g $ cat /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf [Timer] OnCalendar= OnCalendar=*-*-* 03:00 RandomizedDelaySec=15m $ sudo systemctl daemon-reload $ systemctl list-timers apt-daily-upgrade.timer --no-pager NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2026-11-16 03:07:23 UTC 6h - - apt-daily-upgrade.timer apt-daily-upgrade.service 1 timers listed. Pass --all to see loaded but inactive timers, too. $ sudo journalctl -u apt-daily-upgrade.service --no-pager | tail -n 3 Nov 15 20:47:50 web-server systemd[1]: apt-daily-upgrade.service: Deactivated successfully. Nov 15 20:47:50 web-server systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities. Nov 15 20:47:50 web-server systemd[1]: apt-daily-upgrade.service: Consumed 2min 30.900s CPU time, 1.0G memory peak, 0B memory swap peak. $ sudo tail -n 4 /var/log/unattended-upgrades/unattended-upgrades.log 2026-11-15 20:45:02,263 INFO Initial whitelist (not strict): 2026-11-15 20:45:16,769 INFO Packages that will be upgraded: apt apt-utils bind9-dnsutils bind9-host bind9-libs ca-certificates distro-info-data git git-man libapt-pkg6.0t64 libbrotli1 libc-bin libc-dev-bin libc-devtools libc6 libc6-dev liblzma5 libmspack0t64 libnss3 libpcre2-8-0 libperl5.38t64 linux-headers-generic linux-headers-virtual linux-image-virtual linux-libc-dev linux-tools-common linux-virtual locales perl perl-base perl-modules-5.38 python3-jwt python3-pyasn1 python3-twisted xz-utils zlib1g 2026-11-15 20:45:16,769 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log 2026-11-15 20:47:50,123 INFO All upgrades installed $ ls /var/log/unattended-upgrades/ ls: cannot open directory '/var/log/unattended-upgrades/': Permission denied $ apt list --upgradable 2>/dev/null | grep -c security 0 $ apt list --upgradable 2>/dev/null | grep linux-image $ ls /var/run/reboot-required /var/run/reboot-required $ sudo systemctl start apt-daily-upgrade.service $ ls -l --time-style=+%F /var/lib/apt/periodic/upgrade-stamp -rw-r--r-- 1 root root 0 2026-11-15 /var/lib/apt/periodic/upgrade-stamp $ cat /etc/apt/apt.conf.d/52unattended-upgrades-local Unattended-Upgrade::Allowed-Origins { "${distro_id}:${distro_codename}-updates"; }; Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot-Time "02:00"; $ apt-config dump Unattended-Upgrade::Allowed-Origins Unattended-Upgrade::Allowed-Origins ""; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-updates"; $ sudo unattended-upgrade -v 2>&1 | grep -E "^(Packages that will be upgraded|All upgrades installed|Found /var/run/reboot-required|Shutdown msg)" Packages that will be upgraded: cloud-init distro-info gir1.2-glib-2.0 libglib2.0-0t64 libglib2.0-bin libglib2.0-data libsqlite3-0 python3-distro-info snapd tmux ubuntu-pro-client ubuntu-pro-client-l10n All upgrades installed Found /var/run/reboot-required, rebooting Shutdown msg: b"Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel." $ cat /var/run/reboot-required.pkgs libc6 linux-image-6.8.0-149-generic linux-base $ shutdown --show Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel. $ uname -r 6.8.0-147-generic $ sudo reboot $ uname -r 6.8.0-149-generic $ ls /var/run/reboot-required ls: cannot access '/var/run/reboot-required': No such file or directory $ systemctl list-timers apt-daily-upgrade.timer --no-pager NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2026-11-16 03:03:35 UTC 6h Sun 2026-11-15 20:45:01 UTC - apt-daily-upgrade.timer apt-daily-upgrade.service 1 timers listed. Pass --all to see loaded but inactive timers, too. $ apt-config dump APT::Periodic::Unattended-Upgrade APT::Periodic::Unattended-Upgrade "0"; ------------------------------------------------------------------------------ lynis: its full screen before the first step ------------------------------------------------------------------------------ [ Lynis 3.1.7 ] ################################################################################ Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License. See the LICENSE file for details about using this software. 2007-2025, CISOfy - https://cisofy.com/lynis/ Enterprise support available (compliance, plugins, interface and tools) ################################################################################ [+] Initializing program ------------------------------------ - Detecting OS...  [ DONE ] - Checking profiles... [ DONE ] --------------------------------------------------- Program version: 3.1.7 Operating system: Linux Operating system name: Ubuntu Operating system version: 24.04 End-of-life: NO Kernel version: 6.8.0 Hardware platform: x86_64 Hostname: web-server --------------------------------------------------- Profiles: /tmp/shb-audit/lynis/default.prf Log file: /dev/null Report file: /tmp/shb-audit/report.dat Report version: 1.0 Plugin directory: ./plugins --------------------------------------------------- Auditor: [Not Specified] Language: en Test category: all Test group: all --------------------------------------------------- - Program update status...  [ UNKNOWN ] [+] System tools ------------------------------------ - Scanning available tools... - Checking system binaries... [+] Plugins (phase 1) ------------------------------------ Note: plugins have more extensive tests and may take several minutes to complete   - Plugins enabled [ NONE ] [+] Boot and services ------------------------------------ - Service Manager [ systemd ] - Checking UEFI boot [ DISABLED ] - Checking presence GRUB2 [ FOUND ] - Checking for password protection [ NONE ] - Check running services (systemctl) [ DONE ] Result: found 20 running services - Check enabled services at boot (systemctl) [ DONE ] Result: found 45 enabled services - Check startup files (permissions) [ OK ] - Running 'systemd-analyze security' Unit name (exposure value) and predicate -------------------------------- - ModemManager.service (value=6.3) [ MEDIUM ] - cron.service (value=9.6) [ UNSAFE ] - dbus.service (value=9.5) [ UNSAFE ] - dm-event.service (value=9.5) [ UNSAFE ] - dmesg.service (value=9.6) [ UNSAFE ] - emergency.service (value=9.5) [ UNSAFE ] - getty@tty1.service (value=9.6) [ UNSAFE ] - iscsid.service (value=9.5) [ UNSAFE ] - lvm2-lvmpolld.service (value=9.5) [ UNSAFE ] - multipathd.service (value=9.5) [ UNSAFE ] - networkd-dispatcher.service (value=9.6) [ UNSAFE ] - open-vm-tools.service (value=9.5) [ UNSAFE ] - plymouth-start.service (value=9.5) [ UNSAFE ] - polkit.service (value=1.6) [ PROTECTED ] - rc-local.service (value=9.6) [ UNSAFE ] - rescue.service (value=9.5) [ UNSAFE ] - rsyslog.service (value=6.3) [ MEDIUM ] - serial-getty@ttyS0.service (value=9.6) [ UNSAFE ] - snapd.service (value=9.9) [ UNSAFE ] - ssh.service (value=9.6) [ UNSAFE ] - systemd-ask-password-console.service (value=9.4) [ UNSAFE ] - systemd-ask-password-plymouth.service (value=9.5) [ UNSAFE ] - systemd-ask-password-wall.service (value=9.4) [ UNSAFE ] - systemd-bsod.service (value=9.5) [ UNSAFE ] - systemd-fsckd.service (value=9.5) [ UNSAFE ] - systemd-initctl.service (value=9.4) [ UNSAFE ] - systemd-journald.service (value=4.3) [ PROTECTED ] - systemd-logind.service (value=2.8) [ PROTECTED ] - systemd-networkd.service (value=2.6) [ PROTECTED ] - systemd-resolved.service (value=2.2) [ PROTECTED ] - systemd-rfkill.service (value=9.4) [ UNSAFE ] - systemd-timedated.service (value=2.2) [ PROTECTED ] - systemd-timesyncd.service (value=2.1) [ PROTECTED ] - systemd-udevd.service (value=7.1) [ MEDIUM ] - tpm-udev.service (value=9.6) [ UNSAFE ] - ubuntu-advantage.service (value=9.6) [ UNSAFE ] - udisks2.service (value=9.6) [ UNSAFE ] - unattended-upgrades.service (value=9.6) [ UNSAFE ] - user@0.service (value=9.8) [ UNSAFE ] - uuidd.service (value=5.8) [ MEDIUM ] - vgauth.service (value=9.5) [ UNSAFE ] [+] Kernel ------------------------------------ - Checking default runlevel [ runlevel 5 ] - Checking CPU support (NX/PAE) CPU support: PAE and/or NoeXecute supported [ FOUND ] - Checking kernel version and release [ DONE ] - Checking kernel type [ DONE ] - Checking loaded kernel modules [ DONE ] Found 52 active modules - Checking Linux kernel configuration file [ FOUND ] - Checking default I/O kernel scheduler [ NOT FOUND ] - Checking for available kernel update [ OK ] - Checking core dumps configuration - configuration in systemd conf files [ DEFAULT ] - configuration in /etc/profile [ DEFAULT ] - 'hard' configuration in /etc/security/limits.conf [ DEFAULT ] - 'soft' configuration in /etc/security/limits.conf [ DEFAULT ] - Checking setuid core dumps configuration [ PROTECTED ] - Check if reboot is needed [ NO ] [+] Memory and Processes ------------------------------------ - Checking /proc/meminfo [ FOUND ] - Searching for dead/zombie processes [ NOT FOUND ] - Searching for IO waiting processes [ NOT FOUND ] - Search prelink tooling [ NOT FOUND ] [+] Users, Groups and Authentication ------------------------------------ - Administrator accounts [ OK ] - Unique UIDs [ OK ] - Consistency of group files (grpck) [ OK ] - Unique group IDs [ OK ] - Unique group names [ OK ] - Password file consistency [ OK ] - Password hashing methods [ OK ] - Checking password hashing rounds [ DISABLED ] - Query system users (non daemons) [ DONE ] - NIS+ authentication support [ NOT ENABLED ] - NIS authentication support [ NOT ENABLED ] - Sudoers file(s) [ FOUND ] - Permissions for directory: /etc/sudoers.d [ WARNING ] - Permissions for: /etc/sudoers [ OK ] - Permissions for: /etc/sudoers.d/90-shb-automation [ OK ] - Permissions for: /etc/sudoers.d/README [ OK ] - PAM password strength tools [ SUGGESTION ] - PAM configuration files (pam.conf) [ FOUND ] - PAM configuration files (pam.d) [ FOUND ] - PAM modules [ FOUND ] - LDAP module in PAM [ NOT FOUND ] - Accounts without expire date [ OK ] - Accounts without password [ OK ] - Locked accounts [ FOUND ] - Checking user password aging (minimum) [ DISABLED ] - User password aging (maximum) [ DISABLED ] - Checking expired passwords [ OK ] - Checking Linux single user mode authentication [ OK ] - Determining default umask - umask (/etc/profile) [ NOT FOUND ] - umask (/etc/login.defs) [ SUGGESTION ] - LDAP authentication support [ NOT ENABLED ] - Logging failed login attempts [ ENABLED ] [+] Kerberos ------------------------------------ - Check for Kerberos KDC and principals [ NOT FOUND ] [+] Shells ------------------------------------ - Checking shells from /etc/shells Result: found 9 shells (valid shells: 9). - Session timeout settings/tools [ NONE ] - Checking default umask values - Checking default umask in /etc/bash.bashrc [ NONE ] - Checking default umask in /etc/profile [ NONE ] [+] File systems ------------------------------------ - Checking mount points - Checking /home mount point [ SUGGESTION ] - Checking /tmp mount point [ SUGGESTION ] - Checking /var mount point [ SUGGESTION ] - Query swap partitions (fstab) [ NONE ] - Testing swap partitions [ OK ] - Testing /proc mount (hidepid) [ SUGGESTION ] - Checking for old files in /tmp [ OK ] - Checking /tmp sticky bit [ OK ] - Checking /var/tmp sticky bit [ OK ] - ACL support root file system [ ENABLED ] - Mount options of / [ NON DEFAULT ] - Mount options of /boot [ DEFAULT ] - Mount options of /dev [ PARTIALLY HARDENED ] - Mount options of /dev/shm [ PARTIALLY HARDENED ] - Mount options of /run [ HARDENED ] - Total without nodev:6 noexec:8 nosuid:4 ro or noexec (W^X): 8 of total 23 - Disable kernel support of some filesystems [+] USB Devices ------------------------------------ - Checking usb-storage driver (modprobe config) [ NOT DISABLED ] - Checking USB devices authorization [ DISABLED ] - Checking USBGuard [ NOT FOUND ] [+] Storage ------------------------------------ - Checking firewire ohci driver (modprobe config) [ DISABLED ] [+] NFS ------------------------------------ - Check running NFS daemon [ NOT FOUND ] [+] Name services ------------------------------------ - Checking search domains [ FOUND ] - Checking /etc/resolv.conf options [ FOUND ] - Searching DNS domain name [ UNKNOWN ] - Checking /etc/hosts - Duplicate entries in hosts file [ NONE ] - Presence of configured hostname in /etc/hosts [ FOUND ] - Hostname mapped to localhost [ NOT FOUND ] - Localhost mapping to IP address [ OK ] [+] Ports and packages ------------------------------------ - Searching package managers - Searching dpkg package manager [ FOUND ] - Querying package manager - Query unpurged packages [ NONE ] - Checking security repository in sources.list.d directory [ OK ] - Checking APT package database [ OK ] - Checking vulnerable packages [ WARNING ] [WARNING]: Test PKGS-7392 had a long execution: 28.330746 seconds - Checking upgradeable packages [ SKIPPED ] - Checking package audit tool [ INSTALLED ] Found: apt-get - Toolkit for automatic upgrades (unattended-upgrade) [ FOUND ] [+] Networking ------------------------------------ - Checking IPv6 configuration [ ENABLED ] Configuration method [ AUTO ] IPv6 only [ NO ] - Checking configured nameservers - Testing nameservers Nameserver: 127.0.0.53 [ OK ] - DNSSEC supported (systemd-resolved) [ UNKNOWN ] - Getting listening ports (TCP/UDP) [ DONE ] - Checking promiscuous interfaces [ OK ] - Checking status DHCP client [ NOT ACTIVE ] - Checking for ARP monitoring software [ NOT FOUND ] - Uncommon network protocols [ 0 ] [+] Printers and Spools ------------------------------------ - Checking cups daemon [ NOT FOUND ] - Checking lp daemon [ NOT RUNNING ] [+] Software: e-mail and messaging ------------------------------------ [+] Software: firewalls ------------------------------------ - Checking iptables kernel module [ FOUND ] - Checking iptables policies of chains [ FOUND ] - Chain INPUT (table: filter, target: ACCEPT) [ ACCEPT ] - Chain INPUT (table: security, target: ACCEPT) [ ACCEPT ] - Checking for empty ruleset [ WARNING ] - Checking for unused rules [ OK ] - Checking host based firewall [ ACTIVE ] [+] Software: webserver ------------------------------------ - Checking Apache [ NOT FOUND ] - Checking nginx [ NOT FOUND ] [+] SSH Support ------------------------------------ - Checking running SSH daemon [ FOUND ] - Searching SSH configuration [ FOUND ] - OpenSSH option: AllowTcpForwarding [ SUGGESTION ] - OpenSSH option: ClientAliveCountMax [ SUGGESTION ] - OpenSSH option: ClientAliveInterval [ OK ] - OpenSSH option: FingerprintHash [ OK ] - OpenSSH option: GatewayPorts [ OK ] - OpenSSH option: IgnoreRhosts [ OK ] - OpenSSH option: LoginGraceTime [ OK ] - OpenSSH option: LogLevel [ SUGGESTION ] - OpenSSH option: MaxAuthTries [ SUGGESTION ] - OpenSSH option: MaxSessions [ SUGGESTION ] - OpenSSH option: PermitRootLogin [ OK ] - OpenSSH option: PermitUserEnvironment [ OK ] - OpenSSH option: PermitTunnel [ OK ] - OpenSSH option: Port [ SUGGESTION ] - OpenSSH option: PrintLastLog [ OK ] - OpenSSH option: StrictModes [ OK ] - OpenSSH option: TCPKeepAlive [ SUGGESTION ] - OpenSSH option: UseDNS [ OK ] - OpenSSH option: X11Forwarding [ SUGGESTION ] - OpenSSH option: AllowAgentForwarding [ SUGGESTION ] - OpenSSH option: AllowUsers [ NOT FOUND ] - OpenSSH option: AllowGroups [ NOT FOUND ] [+] SNMP Support ------------------------------------ - Checking running SNMP daemon [ NOT FOUND ] [+] Databases ------------------------------------ No database engines found [+] LDAP Services ------------------------------------ - Checking OpenLDAP instance [ NOT FOUND ] [+] PHP ------------------------------------ - Checking PHP [ NOT FOUND ] [+] Squid Support ------------------------------------ - Checking running Squid daemon [ NOT FOUND ] [+] Logging and files ------------------------------------ - Checking for a running log daemon [ OK ] - Checking Syslog-NG status [ NOT FOUND ] - Checking systemd journal status [ FOUND ] - Checking Metalog status [ NOT FOUND ] - Checking RSyslog status [ FOUND ] - Checking RFC 3195 daemon status [ NOT FOUND ] - Checking minilogd instances [ NOT FOUND ] - Checking wazuh-agent daemon status [ NOT FOUND ] - Checking logrotate presence [ OK ] - Checking remote logging [ NOT ENABLED ] - Checking log directories (static list) [ DONE ] - Checking open log files [ DONE ] - Checking deleted files in use [ DONE ] [+] Insecure services ------------------------------------ - Installed inetd package [ NOT FOUND ] - Installed xinetd package [ OK ] - xinetd status [ NOT ACTIVE ] - Installed rsh client package [ OK ] - Installed rsh server package [ OK ] - Installed telnet client package [ OK ] - Installed telnet server package [ NOT FOUND ] - Checking NIS client installation [ OK ] - Checking NIS server installation [ OK ] - Checking TFTP client installation [ OK ] - Checking TFTP server installation [ OK ] [+] Banners and identification ------------------------------------ - /etc/issue [ FOUND ] - /etc/issue contents [ WEAK ] - /etc/issue.net [ FOUND ] - /etc/issue.net contents [ WEAK ] [+] Scheduled tasks ------------------------------------ - Checking crontab and cronjob files [ DONE ] [+] Accounting ------------------------------------ - Checking accounting information [ NOT FOUND ] - Checking sysstat accounting data [ DISABLED ] - Checking auditd [ NOT FOUND ] [+] Time and Synchronization ------------------------------------ - NTP daemon found: systemd (timesyncd) [ FOUND ] - Checking for a running NTP daemon or client [ OK ] - Last time synchronization [ 27s ] [+] Cryptography ------------------------------------ - Checking for expired SSL certificates [0/127] [ NONE ] - Found 0 encrypted and 0 unencrypted swap devices in use. [ OK ] - Kernel entropy is sufficient [ YES ] - HW RNG & rngd [ NO ] - SW prng [ NO ] - MOR variable not found [ WEAK ] [+] Virtualization ------------------------------------ [+] Containers ------------------------------------ [+] Security frameworks ------------------------------------ - Checking presence AppArmor [ FOUND ] - Checking AppArmor status [ ENABLED ] Found 29 unconfined processes - Checking presence SELinux [ NOT FOUND ] - Checking presence TOMOYO Linux [ NOT FOUND ] - Checking presence grsecurity [ NOT FOUND ] - Checking for implemented MAC framework [ OK ] [+] Software: file integrity ------------------------------------ - Checking file integrity tools - dm-integrity (status) [ DISABLED ] - dm-verity (status) [ DISABLED ] - Checking presence integrity tool [ NOT FOUND ] [+] Software: System tooling ------------------------------------ - Checking automation tooling - Automation tooling [ NOT FOUND ] - Checking for IDS/IPS tooling [ NONE ] [+] Software: Malware ------------------------------------ - Malware software components [ NOT FOUND ] [+] File Permissions ------------------------------------ - Starting file permissions check File: /boot/grub/grub.cfg [ OK ] File: /etc/crontab [ SUGGESTION ] File: /etc/group [ OK ] File: /etc/group- [ OK ] File: /etc/hosts.allow [ OK ] File: /etc/hosts.deny [ OK ] File: /etc/issue [ OK ] File: /etc/issue.net [ OK ] File: /etc/passwd [ OK ] File: /etc/passwd- [ OK ] File: /etc/ssh/sshd_config [ SUGGESTION ] Directory: /root/.ssh [ OK ] Directory: /etc/cron.d [ SUGGESTION ] Directory: /etc/cron.daily [ SUGGESTION ] Directory: /etc/cron.hourly [ SUGGESTION ] Directory: /etc/cron.weekly [ SUGGESTION ] Directory: /etc/cron.monthly [ SUGGESTION ] [+] Home directories ------------------------------------ - Permissions of home directories [ OK ] - Ownership of home directories [ OK ] - Checking shell history files [ OK ] [+] Kernel Hardening ------------------------------------ - Comparing sysctl key pairs with scan profile - dev.tty.ldisc_autoload (exp: 0) [ DIFFERENT ] - fs.protected_fifos (exp: 2) [ DIFFERENT ] - fs.protected_hardlinks (exp: 1) [ OK ] - fs.protected_regular (exp: 2) [ OK ] - fs.protected_symlinks (exp: 1) [ OK ] - fs.suid_dumpable (exp: 0) [ DIFFERENT ] - kernel.core_uses_pid (exp: 1) [ DIFFERENT ] - kernel.ctrl-alt-del (exp: 0) [ OK ] - kernel.dmesg_restrict (exp: 1) [ OK ] - kernel.kptr_restrict (exp: 2) [ DIFFERENT ] - kernel.modules_disabled (exp: 1) [ DIFFERENT ] - kernel.perf_event_paranoid (exp: 2 3 4) [ OK ] - kernel.randomize_va_space (exp: 2) [ OK ] - kernel.sysrq (exp: 0) [ DIFFERENT ] - kernel.unprivileged_bpf_disabled (exp: 1) [ DIFFERENT ] - kernel.yama.ptrace_scope (exp: 1 2 3) [ OK ] - net.core.bpf_jit_harden (exp: 2) [ DIFFERENT ] - net.ipv4.conf.all.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.all.accept_source_route (exp: 0) [ OK ] - net.ipv4.conf.all.bootp_relay (exp: 0) [ OK ] - net.ipv4.conf.all.forwarding (exp: 0) [ OK ] - net.ipv4.conf.all.log_martians (exp: 1) [ DIFFERENT ] - net.ipv4.conf.all.mc_forwarding (exp: 0) [ OK ] - net.ipv4.conf.all.proxy_arp (exp: 0) [ OK ] - net.ipv4.conf.all.rp_filter (exp: 1) [ DIFFERENT ] - net.ipv4.conf.all.send_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.accept_source_route (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.log_martians (exp: 1) [ DIFFERENT ] - net.ipv4.icmp_echo_ignore_broadcasts (exp: 1) [ OK ] - net.ipv4.icmp_ignore_bogus_error_responses (exp: 1) [ OK ] - net.ipv4.tcp_syncookies (exp: 1) [ OK ] - net.ipv4.tcp_timestamps (exp: 0 1) [ OK ] - net.ipv6.conf.all.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv6.conf.all.accept_source_route (exp: 0) [ OK ] - net.ipv6.conf.default.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv6.conf.default.accept_source_route (exp: 0) [ OK ] [+] Hardening ------------------------------------ - Installed compiler(s) [ NOT FOUND ] - Installed malware scanner [ NOT FOUND ] - Non-native binary formats [ FOUND ] [+] Custom tests ------------------------------------ - Running custom tests...  [ NONE ] [+] Plugins (phase 2) ------------------------------------ ================================================================================ -[ Lynis 3.1.7 Results ]- Great, no warnings No suggestions ================================================================================ Lynis security scan details: Scan mode: Normal [▆] Forensics [ ] Integration [ ] Pentest [ ] Lynis modules: - Compliance status [?] - Security audit [V] - Vulnerability scan [V] Details: Hardening index : 62 [############ ] Tests performed : 253 Plugins enabled : 0 Software components: - Firewall [V] - Intrusion software [X] - Malware scanner [X] Files: - Test and debug information : /dev/null - Report data : /tmp/shb-audit/report.dat ================================================================================ Lynis 3.1.7 Auditing, system hardening, and compliance for UNIX-based systems (Linux, macOS, BSD, and others) 2007-2025, CISOfy - https://cisofy.com/lynis/ Enterprise support available (compliance, plugins, interface and tools) ================================================================================ [TIP]: Enhance Lynis audits by adding your settings to custom.prf (see /tmp/shb-audit/lynis/default.prf for all settings) ------------------------------------------------------------------------------ lynis: its full screen after the last step ------------------------------------------------------------------------------ [ Lynis 3.1.7 ] ################################################################################ Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License. See the LICENSE file for details about using this software. 2007-2025, CISOfy - https://cisofy.com/lynis/ Enterprise support available (compliance, plugins, interface and tools) ################################################################################ [+] Initializing program ------------------------------------ - Detecting OS...  [ DONE ] - Checking profiles... [ DONE ] --------------------------------------------------- Program version: 3.1.7 Operating system: Linux Operating system name: Ubuntu Operating system version: 24.04 End-of-life: NO Kernel version: 6.8.0 Hardware platform: x86_64 Hostname: web-server --------------------------------------------------- Profiles: /tmp/shb-audit/lynis/default.prf Log file: /dev/null Report file: /tmp/shb-audit/report.dat Report version: 1.0 Plugin directory: ./plugins --------------------------------------------------- Auditor: [Not Specified] Language: en Test category: all Test group: all --------------------------------------------------- - Program update status...  [ UNKNOWN ] [+] System tools ------------------------------------ - Scanning available tools... - Checking system binaries... [+] Plugins (phase 1) ------------------------------------ Note: plugins have more extensive tests and may take several minutes to complete   - Plugins enabled [ NONE ] [+] Boot and services ------------------------------------ - Service Manager [ systemd ] - Checking UEFI boot [ DISABLED ] - Checking presence GRUB2 [ FOUND ] - Checking for password protection [ NONE ] - Check running services (systemctl) [ DONE ] Result: found 20 running services - Check enabled services at boot (systemctl) [ DONE ] Result: found 45 enabled services - Check startup files (permissions) [ OK ] - Running 'systemd-analyze security' Unit name (exposure value) and predicate -------------------------------- - ModemManager.service (value=6.3) [ MEDIUM ] - cron.service (value=9.6) [ UNSAFE ] - dbus.service (value=9.5) [ UNSAFE ] - dm-event.service (value=9.5) [ UNSAFE ] - dmesg.service (value=9.6) [ UNSAFE ] - emergency.service (value=9.5) [ UNSAFE ] - getty@tty1.service (value=9.6) [ UNSAFE ] - iscsid.service (value=9.5) [ UNSAFE ] - lvm2-lvmpolld.service (value=9.5) [ UNSAFE ] - multipathd.service (value=9.5) [ UNSAFE ] - networkd-dispatcher.service (value=9.6) [ UNSAFE ] - open-vm-tools.service (value=9.5) [ UNSAFE ] - plymouth-start.service (value=9.5) [ UNSAFE ] - polkit.service (value=1.6) [ PROTECTED ] - rc-local.service (value=9.6) [ UNSAFE ] - rescue.service (value=9.5) [ UNSAFE ] - rsyslog.service (value=6.3) [ MEDIUM ] - serial-getty@ttyS0.service (value=9.6) [ UNSAFE ] - snapd.service (value=9.9) [ UNSAFE ] - ssh.service (value=9.6) [ UNSAFE ] - systemd-ask-password-console.service (value=9.4) [ UNSAFE ] - systemd-ask-password-plymouth.service (value=9.5) [ UNSAFE ] - systemd-ask-password-wall.service (value=9.4) [ UNSAFE ] - systemd-bsod.service (value=9.5) [ UNSAFE ] - systemd-fsckd.service (value=9.5) [ UNSAFE ] - systemd-initctl.service (value=9.4) [ UNSAFE ] - systemd-journald.service (value=4.3) [ PROTECTED ] - systemd-logind.service (value=2.8) [ PROTECTED ] - systemd-networkd.service (value=2.6) [ PROTECTED ] - systemd-resolved.service (value=2.2) [ PROTECTED ] - systemd-rfkill.service (value=9.4) [ UNSAFE ] - systemd-timedated.service (value=2.2) [ PROTECTED ] - systemd-timesyncd.service (value=2.1) [ PROTECTED ] - systemd-udevd.service (value=7.1) [ MEDIUM ] - tpm-udev.service (value=9.6) [ UNSAFE ] - ubuntu-advantage.service (value=9.6) [ UNSAFE ] - udisks2.service (value=9.6) [ UNSAFE ] - unattended-upgrades.service (value=9.6) [ UNSAFE ] - user@0.service (value=9.8) [ UNSAFE ] - uuidd.service (value=5.8) [ MEDIUM ] - vgauth.service (value=9.5) [ UNSAFE ] [+] Kernel ------------------------------------ - Checking default runlevel [ runlevel 5 ] - Checking CPU support (NX/PAE) CPU support: PAE and/or NoeXecute supported [ FOUND ] - Checking kernel version and release [ DONE ] - Checking kernel type [ DONE ] - Checking loaded kernel modules [ DONE ] Found 54 active modules - Checking Linux kernel configuration file [ FOUND ] - Checking default I/O kernel scheduler [ NOT FOUND ] - Checking for available kernel update [ OK ] - Checking core dumps configuration - configuration in systemd conf files [ DEFAULT ] - configuration in /etc/profile [ DEFAULT ] - 'hard' configuration in /etc/security/limits.conf [ DEFAULT ] - 'soft' configuration in /etc/security/limits.conf [ DEFAULT ] - Checking setuid core dumps configuration [ PROTECTED ] - Check if reboot is needed [ NO ] [+] Memory and Processes ------------------------------------ - Checking /proc/meminfo [ FOUND ] - Searching for dead/zombie processes [ NOT FOUND ] - Searching for IO waiting processes [ NOT FOUND ] - Search prelink tooling [ NOT FOUND ] [+] Users, Groups and Authentication ------------------------------------ - Administrator accounts [ OK ] - Unique UIDs [ OK ] - Consistency of group files (grpck) [ OK ] - Unique group IDs [ OK ] - Unique group names [ OK ] - Password file consistency [ OK ] - Password hashing methods [ OK ] - Checking password hashing rounds [ DISABLED ] - Query system users (non daemons) [ DONE ] - NIS+ authentication support [ NOT ENABLED ] - NIS authentication support [ NOT ENABLED ] - Sudoers file(s) [ FOUND ] - Permissions for directory: /etc/sudoers.d [ WARNING ] - Permissions for: /etc/sudoers [ OK ] - Permissions for: /etc/sudoers.d/90-shb-automation [ OK ] - Permissions for: /etc/sudoers.d/README [ OK ] - PAM password strength tools [ SUGGESTION ] - PAM configuration files (pam.conf) [ FOUND ] - PAM configuration files (pam.d) [ FOUND ] - PAM modules [ FOUND ] - LDAP module in PAM [ NOT FOUND ] - Accounts without expire date [ OK ] - Accounts without password [ OK ] - Locked accounts [ FOUND ] - Checking user password aging (minimum) [ DISABLED ] - User password aging (maximum) [ DISABLED ] - Checking expired passwords [ OK ] - Checking Linux single user mode authentication [ OK ] - Determining default umask - umask (/etc/profile) [ NOT FOUND ] - umask (/etc/login.defs) [ SUGGESTION ] - LDAP authentication support [ NOT ENABLED ] - Logging failed login attempts [ ENABLED ] [+] Kerberos ------------------------------------ - Check for Kerberos KDC and principals [ NOT FOUND ] [+] Shells ------------------------------------ - Checking shells from /etc/shells Result: found 9 shells (valid shells: 9). - Session timeout settings/tools [ NONE ] - Checking default umask values - Checking default umask in /etc/bash.bashrc [ NONE ] - Checking default umask in /etc/profile [ NONE ] [+] File systems ------------------------------------ - Checking mount points - Checking /home mount point [ SUGGESTION ] - Checking /tmp mount point [ SUGGESTION ] - Checking /var mount point [ SUGGESTION ] - Query swap partitions (fstab) [ NONE ] - Testing swap partitions [ OK ] - Testing /proc mount (hidepid) [ SUGGESTION ] - Checking for old files in /tmp [ OK ] - Checking /tmp sticky bit [ OK ] - Checking /var/tmp sticky bit [ OK ] - ACL support root file system [ ENABLED ] - Mount options of / [ NON DEFAULT ] - Mount options of /boot [ DEFAULT ] - Mount options of /dev [ PARTIALLY HARDENED ] - Mount options of /dev/shm [ PARTIALLY HARDENED ] - Mount options of /run [ HARDENED ] - Total without nodev:6 noexec:8 nosuid:4 ro or noexec (W^X): 8 of total 23 - Disable kernel support of some filesystems [+] USB Devices ------------------------------------ - Checking usb-storage driver (modprobe config) [ NOT DISABLED ] - Checking USB devices authorization [ DISABLED ] - Checking USBGuard [ NOT FOUND ] [+] Storage ------------------------------------ - Checking firewire ohci driver (modprobe config) [ DISABLED ] [+] NFS ------------------------------------ - Check running NFS daemon [ NOT FOUND ] [+] Name services ------------------------------------ - Checking search domains [ FOUND ] - Checking /etc/resolv.conf options [ FOUND ] - Searching DNS domain name [ UNKNOWN ] - Checking /etc/hosts - Duplicate entries in hosts file [ NONE ] - Presence of configured hostname in /etc/hosts [ FOUND ] - Hostname mapped to localhost [ NOT FOUND ] - Localhost mapping to IP address [ OK ] [+] Ports and packages ------------------------------------ - Searching package managers - Searching dpkg package manager [ FOUND ] - Querying package manager - Query unpurged packages [ NONE ] - Checking security repository in sources.list.d directory [ OK ] - Checking APT package database [ OK ] - Checking vulnerable packages [ OK ] - Checking upgradeable packages [ SKIPPED ] - Checking package audit tool [ INSTALLED ] Found: apt-check - Toolkit for automatic upgrades (unattended-upgrade) [ FOUND ] [+] Networking ------------------------------------ - Checking IPv6 configuration [ ENABLED ] Configuration method [ AUTO ] IPv6 only [ NO ] - Checking configured nameservers - Testing nameservers Nameserver: 127.0.0.53 [ OK ] - DNSSEC supported (systemd-resolved) [ UNKNOWN ] - Getting listening ports (TCP/UDP) [ DONE ] - Checking promiscuous interfaces [ OK ] - Checking status DHCP client [ NOT ACTIVE ] - Checking for ARP monitoring software [ NOT FOUND ] - Uncommon network protocols [ 0 ] [+] Printers and Spools ------------------------------------ - Checking cups daemon [ NOT FOUND ] - Checking lp daemon [ NOT RUNNING ] [+] Software: e-mail and messaging ------------------------------------ [+] Software: firewalls ------------------------------------ - Checking iptables kernel module [ FOUND ] - Checking iptables policies of chains [ FOUND ] - Chain INPUT (table: filter, target: ACCEPT) [ ACCEPT ] - Chain INPUT (table: security, target: ACCEPT) [ ACCEPT ] - Checking for empty ruleset [ WARNING ] - Checking for unused rules [ OK ] - Checking host based firewall [ ACTIVE ] [+] Software: webserver ------------------------------------ - Checking Apache [ NOT FOUND ] - Checking nginx [ NOT FOUND ] [+] SSH Support ------------------------------------ - Checking running SSH daemon [ FOUND ] - Searching SSH configuration [ FOUND ] - OpenSSH option: AllowTcpForwarding [ SUGGESTION ] - OpenSSH option: ClientAliveCountMax [ SUGGESTION ] - OpenSSH option: ClientAliveInterval [ OK ] - OpenSSH option: FingerprintHash [ OK ] - OpenSSH option: GatewayPorts [ OK ] - OpenSSH option: IgnoreRhosts [ OK ] - OpenSSH option: LoginGraceTime [ OK ] - OpenSSH option: LogLevel [ SUGGESTION ] - OpenSSH option: MaxAuthTries [ SUGGESTION ] - OpenSSH option: MaxSessions [ SUGGESTION ] - OpenSSH option: PermitRootLogin [ OK ] - OpenSSH option: PermitUserEnvironment [ OK ] - OpenSSH option: PermitTunnel [ OK ] - OpenSSH option: Port [ SUGGESTION ] - OpenSSH option: PrintLastLog [ OK ] - OpenSSH option: StrictModes [ OK ] - OpenSSH option: TCPKeepAlive [ SUGGESTION ] - OpenSSH option: UseDNS [ OK ] - OpenSSH option: X11Forwarding [ SUGGESTION ] - OpenSSH option: AllowAgentForwarding [ SUGGESTION ] - OpenSSH option: AllowUsers [ NOT FOUND ] - OpenSSH option: AllowGroups [ NOT FOUND ] [+] SNMP Support ------------------------------------ - Checking running SNMP daemon [ NOT FOUND ] [+] Databases ------------------------------------ No database engines found [+] LDAP Services ------------------------------------ - Checking OpenLDAP instance [ NOT FOUND ] [+] PHP ------------------------------------ - Checking PHP [ NOT FOUND ] [+] Squid Support ------------------------------------ - Checking running Squid daemon [ NOT FOUND ] [+] Logging and files ------------------------------------ - Checking for a running log daemon [ OK ] - Checking Syslog-NG status [ NOT FOUND ] - Checking systemd journal status [ FOUND ] - Checking Metalog status [ NOT FOUND ] - Checking RSyslog status [ FOUND ] - Checking RFC 3195 daemon status [ NOT FOUND ] - Checking minilogd instances [ NOT FOUND ] - Checking wazuh-agent daemon status [ NOT FOUND ] - Checking logrotate presence [ OK ] - Checking remote logging [ NOT ENABLED ] - Checking log directories (static list) [ DONE ] - Checking open log files [ DONE ] - Checking deleted files in use [ DONE ] [+] Insecure services ------------------------------------ - Installed inetd package [ NOT FOUND ] - Installed xinetd package [ OK ] - xinetd status [ NOT ACTIVE ] - Installed rsh client package [ OK ] - Installed rsh server package [ OK ] - Installed telnet client package [ OK ] - Installed telnet server package [ NOT FOUND ] - Checking NIS client installation [ OK ] - Checking NIS server installation [ OK ] - Checking TFTP client installation [ OK ] - Checking TFTP server installation [ OK ] [+] Banners and identification ------------------------------------ - /etc/issue [ FOUND ] - /etc/issue contents [ WEAK ] - /etc/issue.net [ FOUND ] - /etc/issue.net contents [ WEAK ] [+] Scheduled tasks ------------------------------------ - Checking crontab and cronjob files [ DONE ] [+] Accounting ------------------------------------ - Checking accounting information [ NOT FOUND ] - Checking sysstat accounting data [ DISABLED ] - Checking auditd [ NOT FOUND ] [+] Time and Synchronization ------------------------------------ - NTP daemon found: systemd (timesyncd) [ FOUND ] - Checking for a running NTP daemon or client [ OK ] - Last time synchronization [ 0s ] [+] Cryptography ------------------------------------ - Checking for expired SSL certificates [0/126] [ NONE ] - Found 0 encrypted and 0 unencrypted swap devices in use. [ OK ] - Kernel entropy is sufficient [ YES ] - HW RNG & rngd [ NO ] - SW prng [ NO ] - MOR variable not found [ WEAK ] [+] Virtualization ------------------------------------ [+] Containers ------------------------------------ [+] Security frameworks ------------------------------------ - Checking presence AppArmor [ FOUND ] - Checking AppArmor status [ ENABLED ] Found 29 unconfined processes - Checking presence SELinux [ NOT FOUND ] - Checking presence TOMOYO Linux [ NOT FOUND ] - Checking presence grsecurity [ NOT FOUND ] - Checking for implemented MAC framework [ OK ] [+] Software: file integrity ------------------------------------ - Checking file integrity tools - dm-integrity (status) [ DISABLED ] - dm-verity (status) [ DISABLED ] - Checking presence integrity tool [ NOT FOUND ] [+] Software: System tooling ------------------------------------ - Checking automation tooling - Automation tooling [ NOT FOUND ] - Checking for IDS/IPS tooling [ NONE ] [+] Software: Malware ------------------------------------ - Malware software components [ NOT FOUND ] [+] File Permissions ------------------------------------ - Starting file permissions check File: /boot/grub/grub.cfg [ OK ] File: /etc/crontab [ SUGGESTION ] File: /etc/group [ OK ] File: /etc/group- [ OK ] File: /etc/hosts.allow [ OK ] File: /etc/hosts.deny [ OK ] File: /etc/issue [ OK ] File: /etc/issue.net [ OK ] File: /etc/passwd [ OK ] File: /etc/passwd- [ OK ] File: /etc/ssh/sshd_config [ SUGGESTION ] Directory: /root/.ssh [ OK ] Directory: /etc/cron.d [ SUGGESTION ] Directory: /etc/cron.daily [ SUGGESTION ] Directory: /etc/cron.hourly [ SUGGESTION ] Directory: /etc/cron.weekly [ SUGGESTION ] Directory: /etc/cron.monthly [ SUGGESTION ] [+] Home directories ------------------------------------ - Permissions of home directories [ OK ] - Ownership of home directories [ OK ] - Checking shell history files [ OK ] [+] Kernel Hardening ------------------------------------ - Comparing sysctl key pairs with scan profile - dev.tty.ldisc_autoload (exp: 0) [ DIFFERENT ] - fs.protected_fifos (exp: 2) [ DIFFERENT ] - fs.protected_hardlinks (exp: 1) [ OK ] - fs.protected_regular (exp: 2) [ OK ] - fs.protected_symlinks (exp: 1) [ OK ] - fs.suid_dumpable (exp: 0) [ DIFFERENT ] - kernel.core_uses_pid (exp: 1) [ DIFFERENT ] - kernel.ctrl-alt-del (exp: 0) [ OK ] - kernel.dmesg_restrict (exp: 1) [ OK ] - kernel.kptr_restrict (exp: 2) [ DIFFERENT ] - kernel.modules_disabled (exp: 1) [ DIFFERENT ] - kernel.perf_event_paranoid (exp: 2 3 4) [ OK ] - kernel.randomize_va_space (exp: 2) [ OK ] - kernel.sysrq (exp: 0) [ DIFFERENT ] - kernel.unprivileged_bpf_disabled (exp: 1) [ DIFFERENT ] - kernel.yama.ptrace_scope (exp: 1 2 3) [ OK ] - net.core.bpf_jit_harden (exp: 2) [ DIFFERENT ] - net.ipv4.conf.all.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.all.accept_source_route (exp: 0) [ OK ] - net.ipv4.conf.all.bootp_relay (exp: 0) [ OK ] - net.ipv4.conf.all.forwarding (exp: 0) [ OK ] - net.ipv4.conf.all.log_martians (exp: 1) [ DIFFERENT ] - net.ipv4.conf.all.mc_forwarding (exp: 0) [ OK ] - net.ipv4.conf.all.proxy_arp (exp: 0) [ OK ] - net.ipv4.conf.all.rp_filter (exp: 1) [ DIFFERENT ] - net.ipv4.conf.all.send_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.accept_source_route (exp: 0) [ DIFFERENT ] - net.ipv4.conf.default.log_martians (exp: 1) [ DIFFERENT ] - net.ipv4.icmp_echo_ignore_broadcasts (exp: 1) [ OK ] - net.ipv4.icmp_ignore_bogus_error_responses (exp: 1) [ OK ] - net.ipv4.tcp_syncookies (exp: 1) [ OK ] - net.ipv4.tcp_timestamps (exp: 0 1) [ OK ] - net.ipv6.conf.all.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv6.conf.all.accept_source_route (exp: 0) [ OK ] - net.ipv6.conf.default.accept_redirects (exp: 0) [ DIFFERENT ] - net.ipv6.conf.default.accept_source_route (exp: 0) [ OK ] [+] Hardening ------------------------------------ - Installed compiler(s) [ NOT FOUND ] - Installed malware scanner [ NOT FOUND ] - Non-native binary formats [ FOUND ] [+] Custom tests ------------------------------------ - Running custom tests...  [ NONE ] [+] Plugins (phase 2) ------------------------------------ ================================================================================ -[ Lynis 3.1.7 Results ]- Great, no warnings No suggestions ================================================================================ Lynis security scan details: Scan mode: Normal [▆] Forensics [ ] Integration [ ] Pentest [ ] Lynis modules: - Compliance status [?] - Security audit [V] - Vulnerability scan [V] Details: Hardening index : 67 [############# ] Tests performed : 253 Plugins enabled : 0 Software components: - Firewall [V] - Intrusion software [X] - Malware scanner [X] Files: - Test and debug information : /dev/null - Report data : /tmp/shb-audit/report.dat ================================================================================ Lynis 3.1.7 Auditing, system hardening, and compliance for UNIX-based systems (Linux, macOS, BSD, and others) 2007-2025, CISOfy - https://cisofy.com/lynis/ Enterprise support available (compliance, plugins, interface and tools) ================================================================================ [TIP]: Enhance Lynis audits by adding your settings to custom.prf (see /tmp/shb-audit/lynis/default.prf for all settings) ------------------------------------------------------------------------------ The check's source (scripts/live/checks/unattended-upgrades-ubuntu.mjs) As it ran. ------------------------------------------------------------------------------ /** * KB: Automatic security updates on Ubuntu 26.04 and 24.04 (unattended-upgrades; run per release, --releases=26.04,24.04): check it is on, pick the time, prove it ran, * add regular updates and an automatic reboot, undo. * * The server is a fresh VM box from Ubuntu's cloud image, reached as the sudo user `deploy`. Its packages are as old as * the image, so real security updates are waiting, and the newer kernel sits in noble-updates: this is what a new VPS * looks like. The timer is moved to a time two minutes ahead (a hidden step, then put back) so the run is the TIMER's * own run, not one we started by hand. Every claim below is one the article makes. */ import { rebootBox } from '../box.mjs' import { bareBox, reportBox } from '../lib.mjs' export const meta = { audits: ['lynis'] } const RELEASE = process.env.LIVE_BOX_RELEASE || '24.04' const sleep = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms) const LOG = '/var/log/unattended-upgrades/unattended-upgrades.log' const DROPIN = '/etc/systemd/system/apt-daily-upgrade.timer.d/override.conf' const check = (ctx) => bareBox(ctx, async ({ sudoUser }) => { const { run, L } = sudoUser() L('sudo true') // a reader has used sudo before (earlier articles), so Ubuntu's first-sudo hint is not on their screen // after the first sudo (whose one-time hint would otherwise end up in the value): noble (24.04), resolute (26.04) const CODENAME = L('. /etc/os-release; echo "$VERSION_CODENAME"').split('\n').pop() // ── step 1: it is already on ───────────────────────────────────────────────────────────── const pkg = run(`dpkg-query -W -f='\${Package} \${Version} \${db:Status-Status}\\n' unattended-upgrades`, { id: 'installed' }) ctx.check('unattended-upgrades is installed on a fresh server', /^unattended-upgrades \S+ installed$/.test(pkg.out), pkg.out) const auto = run('cat /etc/apt/apt.conf.d/20auto-upgrades', { id: '20auto' }) ctx.check('20auto-upgrades already turns on the daily list update and the daily upgrade', /APT::Periodic::Update-Package-Lists "1";/.test(auto.out) && /APT::Periodic::Unattended-Upgrade "1";/.test(auto.out), auto.out, { reader: { cmd: 'apt-config dump APT::Periodic::Unattended-Upgrade', expect: 'APT::Periodic::Unattended-Upgrade "1";' }, }) const timers = run('systemctl list-timers apt-daily.timer apt-daily-upgrade.timer --no-pager', { id: 'timers' }) ctx.check('two timers drive it: apt-daily (lists) and apt-daily-upgrade (install)', /apt-daily\.timer/.test(timers.out) && /apt-daily-upgrade\.timer/.test(timers.out) && /2 timers listed/.test(timers.out), timers.out) const unit = run('systemctl cat apt-daily-upgrade.timer --no-pager', { id: 'timer-unit' }) ctx.check('the install timer runs at 6:00 plus up to 60 minutes at random, and catches up after downtime', /OnCalendar=\*-\*-\* 6:00/.test(unit.out) && /RandomizedDelaySec=60m/.test(unit.out) && /Persistent=true/.test(unit.out), unit.out) const tz = run('timedatectl show -p Timezone', { id: 'timezone' }) ctx.check('the server clock is UTC, so 6:00 means 6:00 UTC', tz.out === 'Timezone=Etc/UTC', tz.out) // ── step 2: what it installs ───────────────────────────────────────────────────────────── const origins = run(`apt-config dump Unattended-Upgrade::Allowed-Origins`, { id: 'origins' }) ctx.check('it takes packages from the release and -security pockets only (and Ubuntu Pro ESM)', /-security";/.test(origins.out) && !/-updates";/.test(origins.out), origins.out) run('sudo apt update', { id: 'apt-update', timeout: 600000 }) const up = run('apt list --upgradable 2>/dev/null | grep -c security', { show: 'apt list --upgradable 2>/dev/null | grep -c security', id: 'count-security' }) const nSec = Number(up.out.split('\n').pop()) ctx.check('a new server has security updates waiting', nSec > 0, up.out) const kern = run('apt list --upgradable 2>/dev/null | grep linux-image', { id: 'kernel-pending' }) // What waits changes with the day's updates, so the claims follow what the box shows (2026-11-15): on 24.04 the // newer kernel was first only in noble-updates (run of 2026-11-11), then published to noble-security too; the // 26.04 image has the current kernel, and its security updates include libc6, which needs a reboot. const kernelLine = (kern.out.match(/^linux-image-virtual\/\S+/m) ?? [''])[0] const kernelIn = kernelLine.includes('-security') ? 'security' : kernelLine ? 'updates' : 'none' if (kernelIn === 'updates') ctx.check(`the newer kernel is waiting too, but in ${CODENAME}-updates only (not -security)`, kernelLine === `linux-image-virtual/${CODENAME}-updates`, kern.out) else if (kernelIn === 'security') ctx.check(`the newer kernel is waiting, and is a security update too (${CODENAME}-updates and -security)`, new RegExp(`linux-image-virtual/${CODENAME}-updates,${CODENAME}-security `).test(kern.out), kern.out) else ctx.check(`no newer kernel is waiting on this ${RELEASE} image`, kern.out === '', kern.out) const dry = run('sudo unattended-upgrade --dry-run -v 2>&1 | grep "Packages that will be upgraded"', { id: 'dry-run', timeout: 900000 }) ctx.check('--dry-run -v lists what the next run will install, without installing (the kernel only when it is a security update)', /Packages that will be upgraded: /.test(dry.out) && /linux-image/.test(dry.out) === (kernelIn === 'security'), dry.out) // ── step 3: pick the time ──────────────────────────────────────────────────────────────── L(`sudo mkdir -p /etc/systemd/system/apt-daily-upgrade.timer.d`) L(`printf '%s\\n' '[Timer]' 'OnCalendar=' 'OnCalendar=*-*-* 03:00' 'RandomizedDelaySec=15m' | sudo tee ${DROPIN} >/dev/null`) const drop = run(`cat ${DROPIN}`, { id: 'dropin' }) ctx.check('(the drop-in is exactly as the article shows it)', drop.out === '[Timer]\nOnCalendar=\nOnCalendar=*-*-* 03:00\nRandomizedDelaySec=15m', drop.out) run('sudo systemctl daemon-reload', { id: 'daemon-reload' }) const next = run('systemctl list-timers apt-daily-upgrade.timer --no-pager', { id: 'timer-0300' }) ctx.check('the next run is now between 03:00 and 03:15', /\s0?3:(0\d|1[0-5]):\d\d UTC/.test(next.out.split('\n')[1] ?? ''), next.out) // (hidden) the timer's own run: move it two minutes ahead with no random delay, wait, put 03:00 back const exitTs = () => L(`systemctl show apt-daily-upgrade.service -p ExecMainExitTimestampMonotonic --value`) const ts0 = exitTs() // the service may already have run once at boot (Persistent=true), so wait for a NEW run const at = L(`date -u -d '+2 min' +%H:%M`) L(`printf '%s\\n' '[Timer]' 'OnCalendar=' 'OnCalendar=*-*-* ${at}' 'RandomizedDelaySec=0' | sudo tee ${DROPIN} >/dev/null && sudo systemctl daemon-reload`) let state = '' for (let i = 0; i < 80; i++) { sleep(15000) state = `${exitTs()} ${L('systemctl is-active apt-daily-upgrade.service')}` if (!state.startsWith(`${ts0} `) && / inactive$/.test(state)) break } ctx.check(`(the timer fired on its own at ${at} UTC and its run finished)`, !state.startsWith(`${ts0} `) && / inactive$/.test(state), `${ts0} → ${state}`) L(`printf '%s\\n' '[Timer]' 'OnCalendar=' 'OnCalendar=*-*-* 03:00' 'RandomizedDelaySec=15m' | sudo tee ${DROPIN} >/dev/null && sudo systemctl daemon-reload`) // ── step 4: check that it ran ──────────────────────────────────────────────────────────── const svc = run('sudo journalctl -u apt-daily-upgrade.service --no-pager | tail -n 3', { id: 'journal' }) ctx.check('the journal shows the timer’s service ran and finished: "Finished apt-daily-upgrade.service"', /Finished apt-daily-upgrade\.service/.test(svc.out), svc.out) const log = run(`sudo tail -n 4 ${LOG}`, { id: 'uu-log' }) ctx.check('its log lists the packages it upgraded and ends "All upgrades installed"', /Packages that will be upgraded: /.test(log.out) && /INFO All upgrades installed/.test(log.out), log.out) const ls = run('ls /var/log/unattended-upgrades/', { id: 'log-dir-denied' }) ctx.check('the log folder is not readable without sudo', ls.exit !== 0 && /Permission denied/.test(ls.out), ls.out) const left = run('apt list --upgradable 2>/dev/null | grep -c security', { id: 'count-security-after' }) ctx.check('no security updates are left', left.out.split('\n').pop() === '0', left.out) const k2 = run('apt list --upgradable 2>/dev/null | grep linux-image', { id: 'kernel-still-pending' }) if (kernelIn === 'updates') ctx.check(`the kernel from ${CODENAME}-updates was left alone`, new RegExp(`linux-image-virtual/${CODENAME}-updates `).test(k2.out), k2.out) const nor = run('ls /var/run/reboot-required', { id: 'no-reboot-flag' }) const securityNeedsReboot = nor.exit === 0 if (!securityNeedsReboot) ctx.check('nothing it installed needs a reboot (no /var/run/reboot-required)', /No such file/.test(nor.out), nor.out) else ctx.check('what it installed needs a reboot: /var/run/reboot-required is there, and nothing reboots by default', securityNeedsReboot && /\/var\/run\/reboot-required/.test(nor.out), nor.out) // troubleshooting: starting it again the same day does nothing (the upgrade stamp) const before = L(`sudo cat ${LOG} | wc -l`) run('sudo systemctl start apt-daily-upgrade.service', { id: 'start-again', timeout: 600000 }) const after = L(`sudo cat ${LOG} | wc -l`) ctx.check('starting the service again the same day does nothing: the log gets no new line', /^\d+$/.test(before) && before === after, `${before} → ${after}`) const stamp = run('ls -l --time-style=+%F /var/lib/apt/periodic/upgrade-stamp', { id: 'stamp' }) ctx.check('…because /var/lib/apt/periodic/upgrade-stamp is dated today', new RegExp(L('date -u +%F')).test(stamp.out), stamp.out) // ── step 5: regular updates and an automatic reboot (optional) ─────────────────────────── L(`printf '%s\\n' 'Unattended-Upgrade::Allowed-Origins {' ' "\${distro_id}:\${distro_codename}-updates";' '};' 'Unattended-Upgrade::Automatic-Reboot "true";' 'Unattended-Upgrade::Automatic-Reboot-Time "02:00";' | sudo tee /etc/apt/apt.conf.d/52unattended-upgrades-local >/dev/null`) const local = run('cat /etc/apt/apt.conf.d/52unattended-upgrades-local', { id: '52local' }) ctx.check('(the 52unattended-upgrades-local file is exactly as the article shows it)', local.out === 'Unattended-Upgrade::Allowed-Origins {\n "${distro_id}:${distro_codename}-updates";\n};\nUnattended-Upgrade::Automatic-Reboot "true";\nUnattended-Upgrade::Automatic-Reboot-Time "02:00";', local.out) const merged = run('apt-config dump Unattended-Upgrade::Allowed-Origins', { id: 'origins-merged' }) ctx.check('the new file ADDS -updates to the list; the default origins stay', /-security";/.test(merged.out) && /-updates";/.test(merged.out), merged.out) const now = run('sudo unattended-upgrade -v 2>&1 | grep -E "^(Packages that will be upgraded|All upgrades installed|Found /var/run/reboot-required|Shutdown msg)"', { id: 'run-updates', timeout: 1800000 }) if (kernelIn === 'updates') ctx.check('a run now installs the kernel from -updates', /Packages that will be upgraded: .*linux-image-virtual/.test(now.out), now.out) else ctx.check('a run now installs the packages waiting in -updates', /Packages that will be upgraded: \S/.test(now.out) && /All upgrades installed/.test(now.out), now.out) ctx.check('…finds /var/run/reboot-required and schedules the reboot for 02:00', /Found \/var\/run\/reboot-required, rebooting/.test(now.out) && /Reboot scheduled for .* 02:00:00 UTC/.test(now.out), now.out) const why = run('cat /var/run/reboot-required.pkgs', { id: 'reboot-pkgs' }) const newKernel = (why.out.match(/^linux-image-(\S+)$/m) ?? [])[1] ?? '' if (newKernel) ctx.check('/var/run/reboot-required.pkgs names the new kernel', /^linux-image-\S+-generic$/m.test(why.out), why.out) else ctx.check('/var/run/reboot-required.pkgs names what needs the reboot (libc6 from the security updates)', /^libc6$/m.test(why.out), why.out) const show = run('shutdown --show', { id: 'shutdown-show' }) ctx.check('shutdown --show confirms the reboot waiting for 02:00 UTC', /Reboot scheduled for .* 02:00:00 UTC/.test(show.out), show.out) const oldKernel = run('uname -r', { id: 'uname-before' }).out if (newKernel) ctx.check('until the reboot the server still runs the old kernel', newKernel !== '' && oldKernel !== newKernel, `${oldKernel} (new: ${newKernel})`) // reboot now instead of waiting for 02:00 (the reader's `sudo reboot`) const secs = rebootBox() ctx.capture('sudo reboot', '', { id: 'reboot' }) ctx.check('the server comes back after the reboot', secs !== null, String(secs)) const k3 = run('uname -r', { id: 'uname-after' }) if (newKernel) ctx.check('after the reboot it runs the new kernel', k3.out === newKernel, k3.out) else ctx.check('after the reboot it runs the same kernel (none was installed)', k3.out === oldKernel, k3.out) const gone = run('ls /var/run/reboot-required', { id: 'flag-gone' }) ctx.check('and /var/run/reboot-required is gone', gone.exit !== 0, gone.out) const timer = run('systemctl list-timers apt-daily-upgrade.timer --no-pager', { id: 'timer-after-reboot' }) ctx.check('the 03:00 time survives the reboot', /\s0?3:(0\d|1[0-5]):\d\d UTC/.test(timer.out.split('\n')[1] ?? ''), timer.out, { reader: { cmd: 'systemctl list-timers apt-daily-upgrade.timer --no-pager', expect: '\\s0?3:(0\\d|1[0-5]):\\d\\d ' }, }) ctx.stepsDone() // the article's steps end here; the undo follows reportBox( ctx, L, `A fresh Ubuntu ${RELEASE} server from Ubuntu’s cloud image, with the updates published since the image was built still waiting, reached over SSH as a sudo user.`, ['unattended-upgrades', 'apt', 'linux-image-virtual'], ) // ── undo: turn automatic upgrades off ──────────────────────────────────────────────────── L(`printf '%s\\n' 'APT::Periodic::Update-Package-Lists "1";' 'APT::Periodic::Unattended-Upgrade "0";' | sudo tee /etc/apt/apt.conf.d/20auto-upgrades >/dev/null`) const off = run('apt-config dump APT::Periodic::Unattended-Upgrade', { id: 'off' }) ctx.check('Unattended-Upgrade "0" turns the daily install off', /APT::Periodic::Unattended-Upgrade "0";/.test(off.out), off.out) L('sudo rm -f /var/lib/apt/periodic/upgrade-stamp') // so the stamp is not what stops it const b2 = L(`sudo cat ${LOG} | wc -l`) L('sudo systemctl start apt-daily-upgrade.service', 600000) const a2 = L(`sudo cat ${LOG} | wc -l`) ctx.check('(with "0" the timer’s service runs but does not upgrade: no new log line, even with no stamp)', /^\d+$/.test(b2) && b2 === a2, `${b2} → ${a2}`) }) export default check