Thursday, 3 July 2014

passwd expiry in solaris 10

# NDAYS=`/usr/bin/perl -e 'printf("%d\n", time / (3600 * 24))'`
# echo $NDAYS
16255
# cat /etc/shadow|grep test|cut -d ":" -f 3
16250
# user test
changedeltal=totaldays-passwd last change
delta=16255-16250
delta=5

expiredate=maxpasswdexpiry - delta
ex: 13 weeks =91 days
expirfy date=91-5
     86 days to exprie

=======or========
#logins -x -l test
passwd status:-
# logins -x -l test|grep PS|awk '{print $1}'
PS
passwd chaged date:-
# logins -x -l test|grep PS|awk '{print $2}'
070414
passwd min days to expire
# logins -x -l test|grep PS|awk '{print $3}'
10
passwd max days to expire
# logins -x -l test|grep PS|awk '{print $4}'
20

No comments:

Post a Comment