Operating System - HP-UX
1828402 Members
4072 Online
109977 Solutions
New Discussion

Common password for test accounts

 
Renante M. Yu_1
Occasional Advisor

Common password for test accounts

Hi, We're having a testing and I am tasked to create a hundreds of test accounts in HPUX11.11. I already have had this test accounts but my problem was I need to provide them a common password. Please provide me some script to change all the passwords into one.

Thanks
Only dead people have seen peace
4 REPLIES 4
Umapathy S
Honored Contributor

Re: Common password for test accounts

Renante,
passwd is an interactive command. You need expect to do this.
http://expect.nist.gov/

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Umapathy S
Honored Contributor

Re: Common password for test accounts

Pete Randall
Outstanding Contributor

Re: Common password for test accounts

Use SAM (or your favorite method) to set up one test account. Then use vi to duplicate the /etc/passwd entry 99 times and simply change the user name and uid on each entry. You could possibly even script this.


Pete



Pete
Steven Sim Kok Leong
Honored Contributor

Re: Common password for test accounts

Hi,

Adding to what Pete has already mentioned, if your system is trusted or shadowed, make sure that you also update the shadow files or the /tcb files for the new accounts accordingly.

Back to your query, simply use awk to replace the password field in /etc/passwd, shadow or /tcb files, depending on which ones you are using.

Hope this helps. Regards.

Steven Sim Kok Leong