chage — password and account expiry
cheat sheet · Ubuntu 24.04; Bash 5.2 for shell builtins https://lab.dimsanych.ru/en/wiki/chage/Cheat sheet
-
chage -l studentinspect your training account -
sudo chage -l labpausedinspect the target account -
getent passwd labpausedinspect UID and shell separately -
sudo passwd -S labpausedinspect password state separately -
sudo chage -E 1970-01-02 labpausedexpire the training account
Options
-l displays settings, -E sets the account expiration date, and -d sets
the last password change date. -m, -M, and -W control minimum and
maximum password age and advance warnings; -I concerns the period after
password expiry.
The YYYY-MM-DD date format is convenient. Removing expiry with -E -1 is a
separate administrative decision, not a mandatory follow-up to inspection.
Check your version's interface with chage --help.