HPE 9000 and HPE e3000 Servers
cancel
Showing results for 
Search instead for 
Did you mean: 

Passwd scripts on trusted system

 
SOLVED
Go to solution
DLH
Occasional Advisor

Passwd scripts on trusted system

We are concidering moving a large number of servers to a trusted system. The problem we have is that we have thousands of users thru out the world and we allow regional areas to add users and change passwords thru sudo using automated scripts which add new users collected from a data base. We don't have the resources to manage users from a central location. We are basically hacking the /etc/passwd file to add users with a default password which must be changed at the first logon. Does anyone have an idea how we can add users with a script and also set a default password? Adding the user part would be easy using useradd but I can't see anyway to set a password using a script in a trusted system since the password file is shadowed. I don't think that we can use the passwd command in a script in a trusted system.
2 REPLIES 2
Vincenzo Restuccia
Honored Contributor

Re: Passwd scripts on trusted system

You can edit a file of password:
passwd1
passwd2
......
In your script:
while read i
do
passwd<$i
done
Bill Hassell
Honored Contributor
Solution

Re: Passwd scripts on trusted system

You can use the modprpw command. The man page was left out from 10 and 11 but the latest version of 11.x (11.11 or 11i) has the information.


Bill Hassell, sysadmin