Password policy: chage, /etc/login.defs
Sign in to read this lesson
One of the first questions in an audit: how often do passwords change, and when is a temporary employee's account closed? In this lesson we learn chage for existing accounts, /etc/login.defs for new ones, pwquality which sets password complexity, and forcing a password change at first login.
What you will learn
chage -l nameshows password and account ageing;-M 90maximum age,-m 1minimum,-W 7warning,-E 2026-12-31account expiry date.chage -d 0 name— the user must change the password at the next login./etc/login.defs(PASS_MAX_DAYS,PASS_MIN_DAYS,PASS_WARN_AGE) affects only newly created accounts.- Complexity lives in
/etc/security/pwquality.conf:minlen,minclass,dcreditand so on. passwd -S nameshows a short status,faillock --user namethe failed-attempt lock.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.