To get details of user account show account aging, password expiration ,we use the command chage.
With chage command use the option -l or –list.
The chage program requires a shadow password file to be available. The absolute path of shadow file is /etc/shadow. It is notable that /etc/shadow file has password information in encrypted format. In other words, chage command helps to get information from /etc/shadow file.
Note: chage command is also used for setting account and password expiration date-time. For setting these information, the user should be root or privileged user.
Only -l is the option which can also be used by unprivileged user.
Syntax:
#chage -l User-Name
Example: In this example,we will view the account aging information of user called user1.
[root@localhost ~]# chage -l user1
Last password change : April 1, 2014
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 :14
[root@localhost ~]#