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
That bit is stamped once, at join time, and nothing clears it afterwards. Open one of those objects and the userAccountControl will almost certainly read 69632, which is WORKSTATION_TRUST_ACCOUNT (4096) plus DONT_EXPIRE_PASSWORD (65536). adcli sets it when it creates the account, from an era when Linux clients had no machine-password renewal at all - that only arrived with ad_maximum_machine_account_password_age in SSSD. So ADUC renders "never expires" on hosts that are in fact rotating, because it is reporting how the object was created, not what the host is doing now.
It is also close to cosmetic, which is why your question 2 keeps coming back a no-op: a DC does not expire computer-account passwords the way it expires user passwords. Rotation is client-initiated. Nothing on the AD side is waiting on that flag.
One query separates "join tool stamped it" from "policy set it", and it carries its own control:
Get-ADComputer -Filter * -SearchBase "<your OU>" -Properties userAccountControl,whenCreated,pwdLastSet | group userAccountControl
Windows members in that same OU should come back 4096 while the Linux ones come back 69632. If the split follows the join tool rather than the OU, the flag is an artifact of object creation and there is no policy to go fix.