dump/output/list Linux password expiry info for all users
A command like this should show you the expiration status for all accounts defined in your /etc/passwd
.
cut -f 1 -d: /etc/passwd | xargs -n 1 -I {} bash -c " echo -e '\n{}' ; chage -l {}"
The important command is the chage -l username
. That is the command that returns the expiration status for a user. Chage is also the command you would use to modify expiration rules. You may need to add sudo
before chage
depending on your system setup.