- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Notification of expiring password?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 07:47 AM
09-15-2004 07:47 AM
Thanks,
Jason
Solved! Go to Solution.
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 07:54 AM
09-15-2004 07:54 AM
Re: Notification of expiring password?
Check these links:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=9100
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=352726
HTH.
Regards,
Sri Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 07:55 AM
09-15-2004 07:55 AM
Re: Notification of expiring password?
May be the logins command could help you
Regards,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 07:56 AM
09-15-2004 07:56 AM
Re: Notification of expiring password?
In trusted system, you will have to do passwd -s "user_name", get his expire date, compare it against todays date and if days are eqal to or less then certain days email you. You would require a utility(by A Clay) data hammer for this.
Anil
- Tags:
- trusted mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 07:59 AM
09-15-2004 07:59 AM
Re: Notification of expiring password?
============================================
#!/usr/bin/sh
function last_set_day
{
LSPWCHG=$1
THISYEAR=$(date "+%Y")
MONTH=$(echo $LSPWCHG | cut -d" " -f2 )
DAY=$(echo $LSPWCHG | cut -d" " -f3 )
YEAR=$(echo $LSPWCHG | cut -d" " -f5 )
# calculate number of days in the pw change year
#
if (( YEAR % 4 == 0 )) #IS THIS A LEAP YEAR?
then
JULIEAP=1 #SET DAY OF YR
else
JULIEAP=0
fi
case $MONTH in
Jan) MMOUNT=0;;
Feb) MMOUNT=31;;
Mar) (( MMOUNT = 59 + JULIEAP ));;
Apr) (( MMOUNT = 90 + JULIEAP ));;
May) (( MMOUNT = 120 + JULIEAP ));;
Jun) (( MMOUNT = 151 + JULIEAP ));;
Jul) (( MMOUNT = 181 + JULIEAP ));;
Aug) (( MMOUNT = 212 + JULIEAP ));;
Sep) (( MMOUNT = 243 + JULIEAP ));;
Oct) (( MMOUNT = 273 + JULIEAP ));;
Nov) (( MMOUNT = 304 + JULIEAP ));;
Dec) (( MMOUNT = 334 + JULIEAP ));;
esac
(( COUNTMONTH = MMOUNT + $DAY ))
# add number of DAY up to this YEAR
#
COUNTDAYS=0
while (( YEAR < THISYEAR ))
do
(( COUNTDAYS = COUNTDAYS + 365 ))
if (( YEAR % 4 == 0 )) #IS THIS A LEAP YEAR?
then
(( COUNTDAYS = COUNTDAYS + 1 ))
fi
(( YEAR = YEAR + 1))
done
(( COUNTDAYS = COUNTDAYS + $COUNTMONTH ))
}
#################
#
# Main
#
#################
#################
#
# Figure out the FQDN of the system
#
#################
EXPIRE=0
LOCKED=0
SENDMSG=1
DISABLED=0
awk -F":" '{print $1}' /etc/passwd | xargs -n1 | while read USER
do
echo "$USER" | egrep -q "^smbnull$|^adm$|^bin$|^sys$|^daemon$|^uucp$|^lp$|^nuucp$|^hpdb$|^www$|^soeadm$"
[[ $? -eq 0 ]] && continue
################
#
# Find out the password expiry setting for the user
#
################
EXPTM=$(/usr/lbin/getprpw -l -r -m exptm $USER)
if [ -z "$EXPTM" ] ; then EXPTM=0 ; fi
case $EXPTM in
0|-1)
if [ "$EXPIRE" -gt "0" ] ; then
echo "password for user $USER has not expired"
fi
;;
*) if [ "$EXPIRE" != "1" ] ; then
EXPWARN=$(/usr/lbin/getprpw -l -r -m expwarn $USER)
SPWCHG=$(/usr/lbin/getprpw -l -r -m spwchg $USER)
LFTM=$(/usr/lbin/getprpw -l -r -m lftm $USER)
if [ "$SPWCHG" = "Thu Jan 1 01:00:00 1970" -a "$DISABLED" = "0" ] ; then
echo "user $user never loged in!"
continue
fi
if [ "$spwchg" = "-1" -a "$disabled" = "0" ] ; then
echo "user $user never loged in - date not defined"
continue
fi
last_set_day "$SPWCHG"
days_last_set=$COUNTDAYS
(( CALC_DATE = COUNTDAYS + $EXPTM ))
TODAY=$(date "+%c")
last_set_day "$TODAY"
DAYS_TODAY=$COUNTDAYS
(( EXP_DAYS = CALC_DATE - DAYS_TODAY ))
(( EXP_MSG = EXP_DAYS - EXPWARN ))
if [ "$EXP_DAYS" -ge "$LFTM" ] ; then
EXP_MSG="0"
EXP_DAYS=-1
fi
if [ "$EXP_MSG" -le "0" ] ; then
if [ "$EXP_DAYS" -lt "0" ] ; then
echo "Password for user $USER has expired!"
else
if [ "$DISABLED" = "0" -a $EXP_DAYS -le $EXP_WARN ]
then
echo "Password for user $USER expire in $EXP_DAYS days!"
fi
fi
else
echo "Account ${USER} expire in $EXP_DAYS Days!"
fi
else
if [ "$DISABLED" = "0" ] ; then
echo "password for user $USER expire in $EXP_DAYS Days!"
fi
fi
;;
esac
done
============================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 08:07 AM
09-15-2004 08:07 AM
SolutionYou can also try this link from itrc,
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&admit=-1335382922+1095278623549+28353475&docId=200000074740865
The itrc doc id is USECKBAN00000934.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 08:56 AM
09-15-2004 08:56 AM
Re: Notification of expiring password?
My version of it. It's a very simple script and you can easily tailor it to your needs.
Basically this is the approach.
1. Create a file say /etc/expirytab every day night at 12:00 AM. It's a comma seperated file with user, date of the last password change, date of expiry and days left before password expiry. See below for the script to do it for you.
2. Put a small script in /etc/profile and /etc/csh.login that does the following
a. Get the user.
b. Get "how many days before the password expires from now" from /etc/expirytab
c. Compare it against site 'notification policy' say 15. If it is less than the notification policy, then print a statement similar to standard notification message along with the other details like when the user changed the password, when the password will expire etc.,
If you want you can even add code into 'script1' to send mails to the users and skip step2.
For getting the expiry information, here is the script. You may need to add some checks like if the user file is not there etc., etc. otherwise 'awk' will hang.
--start of the script --
#!/usr/bin/ksh
EXPIRE=60
NOW=$(/usr/contrib/bin/perl -e 'printf "%d\n",time()')
if [ ! -d /tcb ]
then
echo "Only on trusted systems"
exit 1
fi
rm -f /etc/expiry.tab
for USER in $(logins|awk '{print $1}')
do
FIRST=$(echo $USER|cut -c1)
USERFILE="/tcb/files/auth/${FIRST}/${USER}"
THEN=$(awk '/u_succhg/ {FS="u_succhg";print $2}' $USERFILE | awk '{FS=":";print $1}'|sed '
s/#//')
WHEN_CHANGED=$(echo 0d${THEN}=Y | adb)
(( EXPIRES_ON_DATE = $THEN + ( $EXPIRE * 86400 ) ))
(( EXPIRES_IN_DAYS = ( $EXPIRES_ON_DATE - $NOW ) / 86400 ))
EXPIRES_ON_DATE=$(echo 0d${EXPIRES_ON_DATE}=Y |adb)
echo "$USER,$WHEN_CHANGED,$EXPIRES_ON_DATE,$EXPIRES_IN_DAYS" >> /etc/expirytab
done
---end of the script---
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2004 08:49 AM
09-16-2004 08:49 AM
Re: Notification of expiring password?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2013 01:01 AM
05-15-2013 01:01 AM
Re: Notification of expiring password?
Hello
I may have overlooked something in the many many forum posts I have been looking through, but using getprpw on a trusted system seems to be usable only if password expiry has been set per user. When using getprpw with a system wide password aging policy set, but not per user password aging set, getprpw shows an exptm value of -1. Using passwd -sa is only usable on non-trusted systems.
The global password was set in the file /tcb/files/auth/system/default by using SAM, but getprpw does display per-user password expiration time. Neither does the user's /tcb/files/auth/u/user file, since it does not contain
any u_exp when per user password aging is not set.
What command do I use, or how do I calculate the password expiry date on a trusted system (HP-UX 11.11) with a global password expiration value set, considering both password aging, password lifetime and any other values that may influence password aging?
Henrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2013 01:31 AM
09-10-2013 01:31 AM
Re: Notification of expiring password?
hi ,
i trid this command.
passwd -s support
output which i got ,
support PS
what is PS .? can any one explain.
Jagan
- Tags:
- passwd