Hi,
Currently I use the following script to obtain the number of days root password
is expiring. However this script will not work if /etc/shadow do not exist, esp
in an enhanced security mode (where /etc/shadow is not used).
Kindly suggest alternative or how I can work around this - if you can amend
my script's codes, that will be great. I'm using HP-UX B.11.23 U ia64
## Today's date (expressed in epoch format)
today=`perl -e 'printf("%d\n", (time/60/60/24))'`
line=`grep root: /etc/shadow`
USER=root
DAY_LAST_PASS_CHANGE=`echo
$line | awk -F: '{print $3}'`
DAYS_PASS_VALID=`echo $line | awk -F: '{print $5}'`
DAYS_SINCE_LAST_PASS_CHANG
E=`expr $today - $DAY_LAST_PASS_CHANGE`
DAYS_UNTIL_PASS_EXPIRE=`ex
pr $DAYS_PASS_VALID - $DAYS_SINCE_LAST_PASS_CHAN
GE`
echo "Root password expiring in "$DAYS_UNTIL_PASS_EXPIRE" days"
Start Free Trial