- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help
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
Forums
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
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
04-19-2007 05:30 AM
04-19-2007 05:30 AM
However, I only want to know about the passwords that have not changed in over 90 days.
The output of the above command produces this:
langlcx 103 users 20 Claude langlois,,466,
/home1/langlcx
/usr/bin/sh
PS 041307 0 90 7
0 000000
I need to key on the PS 041307 which indicates the last date that the password was changed.
Any tips?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 06:12 AM
04-19-2007 06:12 AM
Re: Script help
The output of passwd -sa might be helpful as a starting point.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 06:23 AM
04-19-2007 06:23 AM
Re: Script help
this should give you the last time a user changed a password
/usr/lbin/getprpw -r -m spwchg
you can have a function in the script that compares the date and if it's more then 90 days to notify you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 06:30 AM
04-19-2007 06:30 AM
Re: Script help
exptm
example
#/usr/lbin/getprpw -r -m exptm root
30
so i know that root still has 30 days before password expire
regards
Aussan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 06:35 AM
04-19-2007 06:35 AM
Re: Script help
Passwd -sa
give me this, not much but a start I guess
nickd PS
archer LK
stephens LK
barthele LK
toigo LK
petrecca LK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 06:38 AM
04-19-2007 06:38 AM
Re: Script help
That is not bad, but I want to do this in all in a script.
I want to run the command and put the output into a file.
Then, i should probably sort the file by date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 07:02 AM
04-19-2007 07:02 AM
Re: Script help
have a for loop that goes throug the user names and does the command
for example
#!/usr/bin/sh
cd /home
for n in *
do
val1=`/usr/lbin/getprpw -r -m exptm $n`
echo "$n has $val1 days left" >> /tmp/myfile
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 08:12 AM
04-19-2007 08:12 AM
Re: Script help
i'm assuming here that if a password has not been changed in over 90 days the account will lock
so you can also do
/usr/lbin/getprpw -r -m lockout
if the value is 1000000 then it's locked out because it's past password lifetime
so in the script you can write
LOCKOUT_VAL=`/usr/lbin/getprpw -r -m lockout $USER_NAME`
if [ $LOCKOUT_VAL -eq 1000000 ]
then
echo "Account for $USER_NAME is past password lifetime" >> /tmp/myfile
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 07:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 12:21 AM
04-23-2007 12:21 AM
Re: Script help
Thank you to all for your suggestions/tips.
Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2007 12:22 AM
04-23-2007 12:22 AM