Operating System - HP-UX
1835105 Members
2149 Online
110076 Solutions
New Discussion

Re: Script setting protected passwords (using setprpwent()?)

 
James Beamish-White
Trusted Contributor

Script setting protected passwords (using setprpwent()?)

Hi all,

I am trying to figure out a way to script setting passwords on a trusted system. I don't know how to program in C, but I do know how to script (sh/ksh). I believe the method is to use setprpwent, but I don't know how to do this. Does anyone have a script to do this?

Regards,
James
GARDENOFEDEN> create light
3 REPLIES 3
David Lodge
Trusted Contributor

Re: Script setting protected passwords (using setprpwent()?)

After thinking a lot around this issue I had some solutions to this issue:
1) write noddy C code to change password
2) do it the way sam does it
3) write a bit of perl to do it

1, has the problem that many SAs nowadays don't know C and makes summat extra to support.
2, has the problem that passwords are given, not made up by the admin
3, has the problem that it is perl :-)

In the end I went for 2 as it is quick and easy and has the advantage of giving secure passwords which the other two don't have...

The command to use is:
/usr/lbin/modprpw -x

It will return a password in standard out...

dav
harry d brown jr
Honored Contributor

Re: Script setting protected passwords (using setprpwent()?)

Not from ksh or sh, but you can from perl. You'll have to add this module to perl if it does not already exist:

http://www.perldoc.com/cpan/Authen/Prot.html

harry

live free or die
Live Free or Die
James Beamish-White
Trusted Contributor

Re: Script setting protected passwords (using setprpwent()?)

Sorry, but these don't solve my problem. I can't use perl as the boxes I have are hardened, and I'm not about to start installing perl to do it.

Anyone out there a C guru and can give me some code for setprpwent?

James
GARDENOFEDEN> create light