Operating System - HP-UX
1751860 Members
5499 Online
108782 Solutions
New Discussion юеВ

Re: passwd global changes question

 
Doug_3
Frequent Advisor

passwd global changes question

Hello, I would like to know how to force a global change to user login in a UNtrusted system. Specifically I want to extend the expire date for all users by either 3 additional months or to a specific date.

I was unable to find a method in the man pages and didn't want to write a script to extract the uid and pipe to a passwd command for all the users grepped.

Thanks in advance,
Doug
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: passwd global changes question

Well, I should tell you if you are too lazy to write a script then tough because that's what it will take. I had a Perl script that was quite close so I spent about 5 minutes getting it done. I can't really do 3 months but I can do 12 weeks (starting every Thursday because 1-Jan-1970 was a Thursday).

Copy the existing passwd file to a temporary location and make a safe copy of the passwd file.

pwadjust.pl < tmpin_passwd > tmpout_passwd

When you have run the script, you can move the output file to /etc/passwd.

Be logged in as root in at least two sessions when you move the file back so that you can get yourself out of trouble as fast as you got yourself in.

There are 2 constants in the script, MIN_UID and ADDITIONAL_WKS. Any passwd entries less than < MIN_UID will pass through unchanged as will any passwd's that don't have aging values. ADDITIONAL_WKS is the increase. The currect setting + ADDIONAL_WKS will not exceed the maximum possible value, 64 weeks.
If it ain't broke, I can fix that.
Hoang Chi Cong_1
Honored Contributor

Re: passwd global changes question

Hi Doug

In UN-trusted system (as you said) don't support for this function!
If you want to configure like as you want, you have to convert your system from Untrusted system to trusted system.


Regard,
HoangChiCong
Looking for a special chance.......
A. Clay Stephenson
Acclaimed Contributor

Re: passwd global changes question

Nonsense, passwd aging has been supported in UNIX for decades --- long before even shadowed passwd's were available much less the tcb database. You certainly don't have all the features that a trusted system provides but basic aging is there and the script I wrote will do the trick ---- even if this is NIS as long as you run it on the master and then do a ypmake to push the changed maps.
If it ain't broke, I can fix that.
Doug_3
Frequent Advisor

Re: passwd global changes question

Ouch!
I wasn't too lazy, just busy. We have 2 hp's that run quite well and I spend almost no time scripting, unless really really needed. So instead of digging into it I submitted a posting.

I thank you for the script, but as you can see from the time I submitted this and the delay in responding, I did find a solution on my own.

Thanks for sharing your script but un-thanks for the snark.
Regards,
Doug
Doug_3
Frequent Advisor

Re: passwd global changes question

crafted own script.