- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to check the password expire date for indi...
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
03-07-2012 08:10 PM
03-07-2012 08:10 PM
how to check the password expire date for indual users
how to check the password expire date for indual users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2012 09:17 PM
03-07-2012 09:17 PM
Re: how to check the password expire date for individual users
What type of passwords so you have? Standard, trusted, enhanced?
With standard, you can use logins: -x -l user1,user2
Unfortunately the result is a DDMMYY last password changed value and a number of days until it expires.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2012 09:40 PM
03-07-2012 09:40 PM
Re: how to check the password expire date for individual users
please find the below output
unix1$logins -x -l rajesh
rajesh 113 admin 105
/home/rajesh
/sbin/sh
PS 030812 0 182 7
we required password expire for trusted system
- Tags:
- date arithmetic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2012 10:48 PM
03-07-2012 10:48 PM
Re: how to check the password expire date for individual users
expwarn=-1
what is the meaning for expwarn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2012 10:55 PM
03-07-2012 10:55 PM
Re: how to check the password expire date for individual users
please find below is my requirment
i need to set a alert mail , whenever password expire time reach, sent mail to perticular user automatiicaly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2012 01:27 AM
03-08-2012 01:27 AM
Re: how to check the password expire date for individual users
>PS 030812 0 182 7
This says the password was reset today (Mar 8) and will expire in 182 days, 26 weeks or about 6 months.
>whenever password expire time reach
You search the forum for similar requests. Otherwise you need to do date arithmetic on the above date and duration. perl will work wonders here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2012 02:29 AM
03-08-2012 02:29 AM
Re: how to check the password expire date for individual users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2012 03:50 AM
03-08-2012 03:50 AM
Re: how to check the password expire date for individual users
> what is the meaning for expwarn
If expwarn is set to "-1", it means "use the system-wide expwarn value". The output of the "logins" command reveals that the system-wide expwarn value in your system is 7 days.
If expwarn is set to any other non-zero value, it means the time (in days) the system warns the user at login time when the password is about to expire.
For example, if the user's password would expire on 14 March and expwarn is set to 14, on 1 March and after that the user will see the message "Your password will expire in NN days." when s/he logs in, until s/he changes the password or the password actually expires.
> PS 030812 0 182 7
The script would need to convert the MMDDYY date 030812 to an Unix timestamp, add 15724800 seconds to the timestamp value ( password max age: 182 days * 24 hours/day * 60 minutes/hour * 60 seconds/minute = 15724800 seconds), subtract the desired warning time, and compare the result to the current Unix timestamp.
The result would be the timestamp when the script should start warning the user: if it is greater than the current timestamp, there is no need to warn that user yet. If the result is less than the current timestamp, the warning should be sent.
If you want to generate a human-readable password expiration date, just convert the password setting date to Unix timestamp and add the password max age to it as above, and convert the result to a human-readable date.
This should be be an easy task for anyone who can write Perl scripts, as Perl has built-in functions for converting human-readable dates to Unix timestamps and vice versa.