ServerHandbook live check: run log ------------------------------------------------------------------------------ Article https://serverhandbook.com/kb/unattended-upgrades-ubuntu Check scripts/live/checks/unattended-upgrades-ubuntu.mjs (sha256 1c464f65fccf8ba077c139a01624b65e9013de62bf014e63f90b624a7fb9423b) Ran at 2026-11-15T14:53:17Z (471 s) Result PASS, all 33 claims held Tested on System Ubuntu 26.04.1 LTS Kernel 7.0.0-43-generic Package unattended-upgrades 2.12ubuntu9 Package apt 3.2.1ubuntu0.1 Package linux-image-virtual 7.0.0-43.43 Setup A fresh Ubuntu 26.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 (0) Packages upgraded (16) distro-info 1.15 -> 1.15ubuntu0.1 libc-bin 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 libc-dev-bin 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 libc-gconv-modules-extra 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 libc6 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 libc6-dev 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 libperl5.40 5.40.1-7ubuntu0.3 -> 5.40.1-7ubuntu0.4 locales 2.43-2ubuntu2.4 -> 2.43-2ubuntu2.7 perl 5.40.1-7ubuntu0.3 -> 5.40.1-7ubuntu0.4 perl-base 5.40.1-7ubuntu0.3 -> 5.40.1-7ubuntu0.4 perl-modules-5.40 5.40.1-7ubuntu0.3 -> 5.40.1-7ubuntu0.4 python3-distro-info 1.15 -> 1.15ubuntu0.1 python3-pyasn1 0.6.3-1ubuntu0.1 -> 0.6.3-1ubuntu0.2 python3-software-properties 0.120.1 -> 0.120.2 snapd 2.77.1+ubuntu26.04.2 -> 2.78+ubuntu26.04 software-properties-common 0.120.1 -> 0.120.2 Packages removed (0) Services enabled at boot (0) Services disabled (0) Listening sockets opened (0) Listening sockets closed (0) Files added in /etc (2) /etc/apt/apt.conf.d/52unattended-upgrades-local /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf Files changed in /etc (1) /etc/ld.so.cache Files removed from /etc (0) Disk used on / (includes logs written during the run): -38.2 MB ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Audit: Lynis 3.1.7, the whole server, before the first step and after the last ------------------------------------------------------------------------------ Hardening index 60 -> 65 (Lynis's own score for this server; not a certification) Warnings 1 -> 0 Suggestions 42 -> 41 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 (33), each with what the run saw ------------------------------------------------------------------------------ 1. ok a bare Ubuntu 26.04 server box (web-server) starts 2. ok unattended-upgrades is installed on a fresh server | unattended-upgrades 2.12ubuntu9 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 | Sun 2026-11-15 18:05:35 UTC 3h 9min - - apt-daily.timer apt-daily.service | Mon 2026-11-16 06:41:21 UTC 15h - - apt-daily-upgrade.timer apt-daily-upgrade.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 | 11 9. ok no newer kernel is waiting on this 26.04 image 10. ok --dry-run -v lists what the next run will install, without installing | Packages that will be upgraded: libc-bin libc-dev-bin libc-gconv-modules-extra libc6 libc6-dev libperl5.40 locales perl perl-base perl-modules-5.40 python3-pyasn1 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:09:08 UTC 12h - - 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 14:58 UTC and its run finished) | 0= | > → 304469879 | > inactive 14. ok the journal shows the timer’s service ran and finished: "Finished apt-daily-upgrade.service" | Nov 15 14:58:24 web-server systemd[1]: apt-daily-upgrade.service: Deactivated successfully. | Nov 15 14:58:24 web-server systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities. | Nov 15 14:58:24 web-server systemd[1]: apt-daily-upgrade.service: Consumed 18.071s CPU time over 22.182s wall clock time, 414.1M memory peak. 15. ok its log lists the packages it upgraded and ends "All upgrades installed" | 2026-11-15 14:58:02,762 INFO Initial whitelist (not strict): | 2026-11-15 14:58:06,836 INFO Packages that will be upgraded: libc-bin libc-dev-bin libc-gconv-modules-extra libc6 libc6-dev libperl5.40 locales perl perl-base perl-modules-5.40 python3-pyasn1 | 2026-11-15 14:58:06,837 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log | 2026-11-15 14:58:23,892 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 | 16 → 16 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: distro-info python3-distro-info python3-software-properties snapd software-properties-common | 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: distro-info python3-distro-info python3-software-properties snapd software-properties-common | 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 what needs the reboot (libc6 from the security updates) | libc6 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 the server comes back after the reboot | 14 28. ok after the reboot it runs the same kernel (none was installed) | 7.0.0-43-generic 29. ok and /var/run/reboot-required is gone | ls: cannot access '/var/run/reboot-required': No such file or directory 30. ok the 03:00 time survives the reboot | NEXT LEFT LAST PASSED UNIT ACTIVATES | Mon 2026-11-16 03:04:13 UTC 12h Sun 2026-11-15 14:58:02 UTC - apt-daily-upgrade.timer apt-daily-upgrade.service | | 1 timers listed. | Pass --all to see loaded but inactive timers, too. 31. ok (tested on) the box reports its OS, kernel and the version of 3 package(s) | PRETTY_NAME="Ubuntu 26.04.1 LTS" | VIRT=none | KERNEL=7.0.0-43-generic | PKG apt 3.2.1ubuntu0.1 | PKG linux-image-virtual 7.0.0-43.43 | PKG unattended-upgrades 2.12ubuntu9 32. ok Unattended-Upgrade "0" turns the daily install off | APT::Periodic::Unattended-Upgrade "0"; 33. ok (with "0" the timer’s service runs but does not upgrade: no new log line, even with no stamp) | 25 → 25 ------------------------------------------------------------------------------ Commands and what they printed (32) ------------------------------------------------------------------------------ $ dpkg-query -W -f='${Package} ${Version} ${db:Status-Status}\n' unattended-upgrades unattended-upgrades 2.12ubuntu9 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 Sun 2026-11-15 18:05:35 UTC 3h 9min - - apt-daily.timer apt-daily.service Mon 2026-11-16 06:41:21 UTC 15h - - apt-daily-upgrade.timer apt-daily-upgrade.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://security.ubuntu.com/ubuntu resolute-security InRelease Hit:2 http://archive.ubuntu.com/ubuntu resolute InRelease Hit:3 http://archive.ubuntu.com/ubuntu resolute-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu resolute-backports InRelease 16 packages can be upgraded. Run 'apt list --upgradable' to see them. $ apt list --upgradable 2>/dev/null | grep -c security 11 $ apt list --upgradable 2>/dev/null | grep linux-image $ sudo unattended-upgrade --dry-run -v 2>&1 | grep "Packages that will be upgraded" Packages that will be upgraded: libc-bin libc-dev-bin libc-gconv-modules-extra libc6 libc6-dev libperl5.40 locales perl perl-base perl-modules-5.40 python3-pyasn1 $ 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:09:08 UTC 12h - - 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 14:58:24 web-server systemd[1]: apt-daily-upgrade.service: Deactivated successfully. Nov 15 14:58:24 web-server systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities. Nov 15 14:58:24 web-server systemd[1]: apt-daily-upgrade.service: Consumed 18.071s CPU time over 22.182s wall clock time, 414.1M memory peak. $ sudo tail -n 4 /var/log/unattended-upgrades/unattended-upgrades.log 2026-11-15 14:58:02,762 INFO Initial whitelist (not strict): 2026-11-15 14:58:06,836 INFO Packages that will be upgraded: libc-bin libc-dev-bin libc-gconv-modules-extra libc6 libc6-dev libperl5.40 locales perl perl-base perl-modules-5.40 python3-pyasn1 2026-11-15 14:58:06,837 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log 2026-11-15 14:58:23,892 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: distro-info python3-distro-info python3-software-properties snapd software-properties-common 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 $ shutdown --show Reboot scheduled for Mon 2026-11-16 02:00:00 UTC, use 'shutdown -c' to cancel. $ uname -r 7.0.0-43-generic $ sudo reboot $ uname -r 7.0.0-43-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:04:13 UTC 12h Sun 2026-11-15 14:58:02 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: 26.04 End-of-life: NO Kernel version: 7.0.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 47 enabled services - Check startup files (permissions) [ OK ] - Running 'systemd-analyze security' Unit name (exposure value) and predicate -------------------------------- - ModemManager.service (value=6.3) [ MEDIUM ] - chrony.service (value=3.7) [ PROTECTED ] - cloud-init-main.service (value=9.5) [ UNSAFE ] - cron.service (value=9.6) [ UNSAFE ] - dbus.service (value=9.2) [ 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-halt.service (value=9.5) [ UNSAFE ] - plymouth-kexec.service (value=9.5) [ UNSAFE ] - plymouth-poweroff.service (value=9.5) [ UNSAFE ] - plymouth-reboot.service (value=9.5) [ UNSAFE ] - plymouth-start.service (value=9.5) [ UNSAFE ] - polkit.service (value=1.2) [ 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 ] - sshd@sshd-keygen.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-hostnamed.service (value=1.7) [ PROTECTED ] - systemd-journald.service (value=4.9) [ PROTECTED ] - systemd-logind.service (value=2.8) [ PROTECTED ] - systemd-networkd.service (value=2.9) [ PROTECTED ] - systemd-resolved.service (value=2.2) [ PROTECTED ] - systemd-rfkill.service (value=9.4) [ UNSAFE ] - systemd-timedated.service (value=2.2) [ 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 71 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 [ ENABLED ] - 'soft' configuration in /etc/security/limits.conf [ DISABLED ] - 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/README [ OK ] - Permissions for: /etc/sudoers.d/90-shb-automation [ 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 [ DISABLED ] [+] 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 [ OK ] - 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 ] - Mount options of /tmp [ PARTIALLY HARDENED ] - Total without nodev:6 noexec:10 nosuid:4 ro or noexec (W^X): 10 of total 28 - 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: 67.513353 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 [ NOT FOUND ] - Checking host based firewall [ NOT 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 [ FILES FOUND ] [+] 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 [ ENABLED ] - Checking auditd [ NOT FOUND ] [+] Time and Synchronization ------------------------------------ - NTP daemon found: chronyd [ FOUND ] - Checking for a running NTP daemon or client [ OK ] [+] Cryptography ------------------------------------ - Checking for expired SSL certificates [0/125] [ 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 31 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) [ OK ] - 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) [ OK ] - 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) [ OK ] - 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) [ 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 : 60 [############ ] Tests performed : 248 Plugins enabled : 0 Software components: - Firewall [X] - 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: 26.04 End-of-life: NO Kernel version: 7.0.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 21 running services - Check enabled services at boot (systemctl) [ DONE ] Result: found 47 enabled services - Check startup files (permissions) [ OK ] - Running 'systemd-analyze security' Unit name (exposure value) and predicate -------------------------------- - ModemManager.service (value=6.3) [ MEDIUM ] - chrony.service (value=3.7) [ PROTECTED ] - cloud-init-main.service (value=9.5) [ UNSAFE ] - cron.service (value=9.6) [ UNSAFE ] - dbus.service (value=9.2) [ 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-halt.service (value=9.5) [ UNSAFE ] - plymouth-kexec.service (value=9.5) [ UNSAFE ] - plymouth-poweroff.service (value=9.5) [ UNSAFE ] - plymouth-reboot.service (value=9.5) [ UNSAFE ] - plymouth-start.service (value=9.5) [ UNSAFE ] - polkit.service (value=1.2) [ 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 ] - sshd@sshd-keygen.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-hostnamed.service (value=1.7) [ PROTECTED ] - systemd-journald.service (value=4.9) [ PROTECTED ] - systemd-logind.service (value=2.8) [ PROTECTED ] - systemd-networkd.service (value=2.9) [ PROTECTED ] - systemd-resolved.service (value=2.2) [ PROTECTED ] - systemd-rfkill.service (value=9.4) [ UNSAFE ] - systemd-timedated.service (value=2.2) [ 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 74 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 [ ENABLED ] - 'soft' configuration in /etc/security/limits.conf [ DISABLED ] - 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/README [ OK ] - Permissions for: /etc/sudoers.d/90-shb-automation [ 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 [ DISABLED ] [+] 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 [ OK ] - 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 ] - Mount options of /tmp [ PARTIALLY HARDENED ] - Total without nodev:6 noexec:10 nosuid:4 ro or noexec (W^X): 10 of total 28 - 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 [ NOT FOUND ] - Checking host based firewall [ NOT 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 [ FILES FOUND ] [+] 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 [ ENABLED ] - Checking auditd [ NOT FOUND ] [+] Time and Synchronization ------------------------------------ - NTP daemon found: chronyd [ FOUND ] - Checking for a running NTP daemon or client [ OK ] [+] Cryptography ------------------------------------ - Checking for expired SSL certificates [0/125] [ 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 31 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) [ OK ] - 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) [ OK ] - 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) [ OK ] - 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) [ 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 : 65 [############# ] Tests performed : 248 Plugins enabled : 0 Software components: - Firewall [X] - 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() const CODENAME = L('. /etc/os-release; echo "$VERSION_CODENAME"') // noble (24.04), resolute (26.04) L('sudo true') // a reader has used sudo before (earlier articles), so Ubuntu's first-sudo hint is not on their screen // ── 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 depends on how old the release's cloud image is: on 24.04 (2026-11) a newer kernel sits in -updates; // the 26.04 image (2026-11-08) has the current kernel, but its security updates include libc6, which needs a // reboot (both seen 2026-11-15). The claims follow what the box shows, and the page says which release did what. const kernelWaiting = /linux-image-virtual\//.test(kern.out) if (kernelWaiting) ctx.check(`the newer kernel is waiting too, but in ${CODENAME}-updates only (not -security)`, new RegExp(`linux-image-virtual/${CODENAME}-updates `).test(kern.out) && !new RegExp(`${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', /Packages that will be upgraded: /.test(dry.out) && !/linux-image/.test(dry.out), 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 (kernelWaiting) 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 (kernelWaiting) ctx.check('nothing it installed needs a reboot (no /var/run/reboot-required)', !securityNeedsReboot && /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 (kernelWaiting) 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' }) if (kernelWaiting) 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 newKernel = (why.out.match(/^linux-image-(\S+)$/m) ?? [])[1] ?? '' const oldKernel = run('uname -r', { id: 'uname-before' }).out if (kernelWaiting) 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 (kernelWaiting) 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