Operating System - HP-UX
1825803 Members
2483 Online
109687 Solutions
New Discussion

Re: Same password for different users

 
Ravindar_1
Occasional Advisor

Same password for different users

I have a HP UX 11.0. Are there any way/script to set the same password for different users?.I require this because i plan to do a load testing of changing the password concurrently for approximately 250 users.
Please give me some suggestions.
6 REPLIES 6
Peter Godron
Honored Contributor

Re: Same password for different users

Ravindar,
probably the quickest way is to get a software product called "expect".
With this you can mimik all the user input to passwd.
Regards
Peter Godron
Honored Contributor

Re: Same password for different users

Ravindar,
forgot to mention software available at:
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
Regards
Ravindar_1
Occasional Advisor

Re: Same password for different users

Peter,
Thanks a lot for your suggestion.. are there any other way/script without using a software to be loaded?.. coz i need to follow lot of procedures(approvals,...) to get s/w loaded to my machine..Pls advise..
Pete Randall
Outstanding Contributor

Re: Same password for different users

Frankly, no, expect is the only reasonable way to accomplish this. The problem is that the passwd command is interactive - it expects a response from the keyboard and the only way to satisfy it is to use something like expect.


Pete

Pete
Bill Hassell
Honored Contributor

Re: Same password for different users

Actually, you can use the undocumented command: /usr/sam/lbin/usermod.sam. This is actually the standard /usr/sbin/usermod command but when it is run under a different name (usermod.sam), it adds the -p option. The -p option requires the fully-encrypted password just as it would appear in /etc/passwd (or the /tcb database). The attached simple program will create an excrypted password that you can paste into the -p option for usermod.sam. Something like this:

cc -o pw pw.c
pw abc123
Usage: pw
Requested pw= abc123, Seed= BJ, encrypted pw= BJkKDVTAGF5fU

/usr/sam/lbin/usermod -p BJkKDVTAGF5fU USER_LOGIN

Now if this is to simply set all the passwords to the same value so the accounts can be exercised at a later time, this is fine.

If however, you are testing what happens when 250 user all type the passwd command at the same time, then usermod.sam is not a good test. The reason is that passwd has a particular code path to validate, encrypt and then update the password file. usermod.sam simply inserts whatever you type
into the password file. I'm not sure why such a load test would be necessary since it will be impossible to coordinate 250 people to type in their new password and hit enter at exactly the same time.


Bill Hassell, sysadmin
Peter Godron
Honored Contributor

Re: Same password for different users

Ravindar,
did the answers resolve your problem?
If not can you please update the thread.

Also please read
(0 points for 15 responses)
http://forums1.itrc.hp.com/service/forums/helptips.do?#34

Regards