Centos: List SSH user last password changed date with cPanel

To secure your server with cPanel, you might want to consider to request your cPanel user to change your password quarterly.

To get this done, you may consider to use the command name chage.

[email protected] [~]# chage -l username
Last password change                                    : Jul 28, 2012
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

To list all user Last password change date, you may do with the following command,

for i in `ls -l /var/cpanel/users | grep -vE '(\.|system)'| awk '{print $9}'`;do echo $i&&chage -l $i|grep Last;done;

Published by

Mick Genie

Mick Genie is the founder of MickGenie.com and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.