Command to find out password expiry

Hi,

I would like to know is there command which will tell me when password will be expire and when last password was changed ?

like on linux chage -l <username?

grep "^${LOGNAME:-$USER}:" /etc/shadow | perl -a -F: -ne '  
printf "%-10s%d\n","Minimum:",$F[3];
printf "%-10s%d\n","Maximum:",$F[4];
printf "%-10s%d\n","Warning:",$F[5];
printf "%s %s\n","Last Change:",scalar localtime($F[2]*3600*24);
printf "%s %s\n","Password Expires:", scalar localtime(($F[2]+$F[4])*3600*24);
'

You might need to

sudo grep ...

or use Solaris RBAC to elevate rights to read /etc/shadow.

passwd -s username
1 Like