Skip to content

Kali template ships service accounts expired at the epoch → every clone boots 'degraded' (user@968/lightdm PAM) #1194

Closed

Description

@Gerrrt

Summary

The Kali template (910 tpl-kali-saruman, and almost certainly the shared 902/903 built from the same packer/kali.pkr.hcl + packer/kali/preseed.cfg.pkrtpl) ships ~14 service accounts with their shadow account-expiry pinned to the epoch (1970-01-02). Every clone therefore boots degraded, because lightdm's systemd user manager fails PAM.

Found on garuda (162) during the #921 §9 desktop pass. Fixed live on garuda (see below); the template still produces it.

Symptom

$ systemctl is-system-running
degraded
$ systemctl --failed
  user@968.service  loaded failed failed  User Manager for UID 968

user@968.service log:

pam_unix(systemd-user:account): account lightdm has expired (account expired)
user@968.service: Failed to set up PAM session: Operation not permitted
user@968.service: Failed at step PAM ... status=224/PAM

UID 968 is lightdm. Its password being locked (L) is correct for a daemon; the problem is shadow field 8 (account expiry) = 1.

Scope — it's blanket, not lightdm-only

Every system account (UID < 1000) created at build time has expiry = epoch:

systemd-network _dhcpcd systemd-timesync tcpdump Debian-snmp mysql
inetsim _gvm pcscd rtkit dnsmasq lightdm nm-openvpn nm-openconnect

root, the operator analyst, and a couple of daemons (sshd, messagebus) are clean. lightdm is the only one that surfaces because it's the only expired account systemd starts a user@<uid>.service for (it lingers a session for the greeter); the rest are pure daemons that never hit PAM's account path, so their expired state is invisible — but it's a latent trap for any of them that later needs a user session.

The greeter itself works (lightdm active, session live), so the desktop is usable — only the systemd state is dirty.

Origin

Not from our build: grep -rniE "chage|usermod +-e|passwd +-e|--expire|expiredate|EXPIRE" packer/ scripts/ tofu/ stacks/ finds nothing that touches account expiry. Last-password-change on these accounts is the build day with expiry at epoch, so it's coming from the Kali installer / package-postinst layer during the preseed install, not from preseed.cfg.pkrtpl.

Fix applied to garuda (live, so #921 isn't left degraded)

# for every UID<1000 account whose shadow expiry field == 1:
chage -E -1 <account>
systemctl start user@968.service

Result: account expires: never, user@968 active, 0 failed units, systemctl is-system-running → running.

Suggested template fix

Clear the spurious expiry in the Kali build so fresh clones aren't born degraded. Minimal, in the preseed late_command (or a first-boot unit):

# Kali package postinsts leave service accounts expired at the epoch; undo it.
awk -F: '$3 < 1000 {print $1}' /etc/passwd | while read -r u; do
  [ "$(getent shadow "$u" | cut -d: -f8)" = "1" ] && chage -E -1 "$u"
done

(Or narrowly: chage -E -1 lightdm, since lightdm is the only one that currently fails — but clearing all of them removes the latent traps.)

To verify

  • Rebuild 910 and confirm a fresh first boot is running, not degraded.
  • Check 902 and 903 (shared file/preseed) for the same condition and fold the fix in once, since the template is shared.

Environment

Activity

  1. Gerrrt commented on Oct 14, 2026

    @Gerrrt
    OwnerAuthor

    Sibling verification (2026-10-14)

    Correcting the "verify 902/903" note above: 903 is tpl-debian-13 (a different, Debian preseed), not a Kali sibling. The shared Kali file (packer/kali.pkr.hcl + packer/kali/preseed.cfg.pkrtpl) backs 910 (Saruman) and 902 (ifrit).

    903 (tpl-debian-13) — same quirk, but latent/benign. Checked via its full clone dot-debian (191):

    system accounts with shadow expiry == epoch (field 8 == 1):
      systemd-network
      systemd-timesync
    no lightdm/gdm/sddm account present
    systemctl is-system-running  -> running   (0 failed units)
    

    So the epoch-expiry quirk is upstream (it shows up even on plain Debian base accounts), but 903 can't produce the degraded symptom: it has no display manager, so no user@<uid>.service is started for those accounts and PAM's account check is never reached. The Kali template is worse purely because it installs lightdm + ~12 more service packages, and lightdm is the one systemd lingers a user manager for.

    902 (ifrit's Kali) — not verified, near-certain. 902 lives on ifrit (not this node), has no running clone (its build is blocked by #790), and Saruman has no libguestfs for an offline disk read. But 902 shares 910's exact Kali preseed, so it will carry the identical full defect (lightdm + the Kali service accounts) and boot degraded like garuda did. Run this on ifrit when 902 is next built/booted:

    getent shadow | awk -F: '$8==1 {print $1}'     # any output => same defect
    systemctl --failed                              # expect user@<lightdm-uid>.service

    Fix scope: the late_command fix belongs in the shared packer/kali/preseed.cfg.pkrtpl (covers 910 + 902 in one change). 903/Debian doesn't need it for the symptom, though the same clear-epoch-expiry step would be harmless there too if we want base accounts clean.

  2. added a commit that references this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions