Linux: Check User Password Expiry Time

Objective: Check the user account password expiry information on Linux.

User password expiry information can be checked using the chage command. It can display password expiry date, the date of last password change and the number of days between password change. All these information is stored in the /etc/shadow file.

To view the user password aging information, run:

$ chage -l ibrahim
Last password change					: Jan 27, 2018
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7

The above account has password aging disabled. An account with password aging set might look like the one below.

$ chage -l admin
Last password change					: Feb 23, 2018
Password expires					: Mar 25, 2018
Password inactive					: never
Account expires						: Jan 01, 2019
Minimum number of days between password change		: 7
Maximum number of days between password change		: 30
Number of days of warning before password expires	: 7

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, perl, php, python, java, javascript, nodejs, angular, react); plays_on(xbox, ps4); linux_desktop_user(true); }