r/linuxadmin • u/maxcoder88 • Aug 31 '26
Linux-joined AD computers keep DONT_EXPIRE_PASSWORD (UAC 65536) set despite active SSSD password rotation — why, and how to fix at scale?
We have a mix of Linux servers (RHEL, SSSD/realmd joined) in our AD forest going back to 2019. Our compliance/health report flags a bunch of them for PasswordNeverExpires = TRUE, but when I cross-check PasswordLastSet against today's date, the passwords are actually rotating (varying DaysSincePwdChange values, roughly in the 4–30 day range across machines) — so SSSD is clearly doing its job on the client side.
A few questions:
1. Why does the ADS_UF_DONT_EXPIRE_PASSWD bit (0x10000) get set on Linux-joined computer objects in the first place?
My understanding is adcli used to set this bit unconditionally from its original 2012 release until v0.9.2 (2021), when it was made optional behind a --dont-expire-password flag. Some of our newer machines (joined in 2026) still show the flag set, which suggests either our join automation is still passing that flag, or something else is setting it.
2. Does the flag actually do anything on a box where SSSD is actively rotating the password?
Per Steve Syfuhs' writeup, DCs don't enforce password expiry for computer accounts — expiry is just a hint for the client's proactive rotation logic, not something the DC checks.
So my read is that clearing the flag on a machine where SSSD is already rotating should be a functional no-op — it just satisfies whatever compliance scanner is checking userAccountControl. Is that correct, or is there a scenario where this bites you?
3. What's the actual best practice in 2026 for fixing this at scale?
- Bulk-clear via
Set-ADComputer -PasswordNeverExpires $falseagainst the whole OU? - Fix it at the source by auditing our join automation (Ansible/Puppet templates) for a stray
--dont-expire-passwordflag? - Or is there a way to have
adcli updateclear the bit itself without a separate LDAP write?
Would appreciate input from anyone who's dealt with mixed Windows/Linux AD estates at scale — especially if there's a gotcha I'm not seeing with ad_maximum_machine_account_password_age (SSSD, default 30 days) vs machine password timeout (Winbindd, default 7 days) that makes bulk-clearing the flag risky.
View all comments
Show parent comment
1
u/PrestigiousOnion1087 Sep 02 '26
One half of your question 2 is still open in here: at scale. Clearing the bit per host is the easy part. Knowing which hosts survive having it cleared is what decides whether you do it at all, and that is the same store-versus-wire split as the rest of this thread. ADUC reports how the object was created. The keytab records what the host has actually been doing.
klist -ket /etc/krb5.keytab | sort -n | tail -1
That prints the entry carrying the highest key version number, with the date it was written. A host whose KVNO has moved within the last machine-password age is genuinely rotating, and clearing DONT_EXPIRE_PASSWORD there costs nothing. A host still sitting on the KVNO it was given at join time is not rotating, and clearing the bit buys an authentication failure roughly one password age later, on a machine nobody is watching. Read-only, one line, no domain admin.
Run it across the flagged set and you get two lists instead of one compliance number. If you paste the KVNO and date pairs back with hostnames stripped, I will collate them into that split and post the result here. Two columns and a date is enough; I would want exactly that before touching a forest of that age.