- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to determine number of days left till 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
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-04-2002 11:43 PM
04-04-2002 11:43 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 11:58 PM
04-04-2002 11:58 PM
Re: How to determine number of days left till password expire?
You could do this writing a small C program using the system call
getprwent() . (see man )
this call returns a struct pr_passwd which holds all informations you want
I use this to generate a mail warning 5 days befor passwords expire
Regards
rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 12:02 AM
04-05-2002 12:02 AM
Re: How to determine number of days left till password expire?
/tcb/files/auth/system/default
and the
/tcb/files/auth/u/user1
files
I think the needed tags are u_exp# and
u_succhg#. If you add these to, and convert
the date, you should be able to construct the
expiration time (i guess).
Hein Coulier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 12:03 AM
04-05-2002 12:03 AM
Re: How to determine number of days left till password expire?
Doesn't "passwd -s -a" give you what you need?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 12:09 AM
04-05-2002 12:09 AM
Re: How to determine number of days left till password expire?
getprpwent().
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 12:43 AM
04-05-2002 12:43 AM
Re: How to determine number of days left till password expire?
And I am also no good in C. Any suggestion?
Deepak : The passwd only gives me the date of enabling the aging of passwords.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 12:53 AM
04-05-2002 12:53 AM
Re: How to determine number of days left till password expire?
getprpwent, getprpwuid, gettprpwaid, and getprpwnam each returns a
pointer to a pr_passwd structure containing the broken-out fields of a
line in the protected password database
, so it's only valid for trusted systems
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 01:03 AM
04-05-2002 01:03 AM
Re: How to determine number of days left till password expire?
You can only set this up within the
confines of a trusted system.
Once setup this type of configuration
can be set per user. You can set up
global rules for most users, and
exceptions for special users should you
wish. These facilities are not available
without the system being setup as
trusted.
If you have a test system, set it as
trusted and check it out. Using 'sam'
is the best way to start.
Cheers
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 06:49 AM
04-05-2002 06:49 AM
Re: How to determine number of days left till password expire?
a string search of the man pages does not return any references to /var/spool/pwgr (no big surprise), but you may find a reference to the files in a security doc or white paper if you search hp's web site.
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 09:37 AM
04-05-2002 09:37 AM
Re: How to determine number of days left till password expire?
You were fortunate in that I already had a Perl script to do this. Note that in a non-trusted environment the expiration is encoded as the number of weeks left in base64. Man 4 passwd for details.
If you execute pwwarn.pl user1 [user2 ...], it will output a line for each user like this
user1 4096
user2 2
user3 0
Where the number is the number of weeks left. 4096 (64 * 64) indicates that this passwd does not expire.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2002 05:54 PM
04-05-2002 05:54 PM
Re: How to determine number of days left till password expire?
I don't know how to run the script that you created... Pls help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 12:18 PM
04-06-2002 12:18 PM
Re: How to determine number of days left till password expire?
e.g. http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/
Execute perl -v to display your version.
The Perl package is installed like any package using swinstall. Typically, you symbolically link /opt/perl5/bin/perl to /usr/bin/perl.
After that you simply execute 'pwwarn.pl tom dick harry' just as you would a shell script. The 'shebang' statement #!/usr/bin/perl automatically causes the shell to invoke perl or your can execute explicitly like 'perl pwwarn.pl tom dick harry'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2002 02:00 AM
04-16-2002 02:00 AM
Re: How to determine number of days left till password expire?
Can I request you to give me the C program ?? Because we will be converting our system into trusted later on. Really appreciate it.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2002 05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2002 04:26 PM
04-16-2002 04:26 PM
Re: How to determine number of days left till password expire?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 11:03 PM
04-17-2002 11:03 PM
Re: How to determine number of days left till password expire?
I get a coredump when running the executable. I compiled it with # cc -o exe source.c
Then when I run the exe, i get this msg -->
/usr/lib/dld.sl: Unresolved symbol: getprpwent (code) from ./pwd_check
Abort(coredump)
Anyone know why?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 11:04 PM
05-07-2002 11:04 PM
Re: How to determine number of days left till password expire?
try compiling with -lsec
cc -o exe source.c -lsec
It will probably only work on a trusted system
Rod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 11:43 PM
05-07-2002 11:43 PM
Re: How to determine number of days left till password expire?
I actually have downloaded another C program from the internet to calculate the number of days between two dates. From there I just write a shell script to use the program to check the number of days before the password expires.