LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Request : set passwords for many users [user accounts exist] using a shell script (http://www.linuxquestions.org/questions/linux-software-2/request-set-passwords-for-many-users-%5Buser-accounts-exist%5D-using-a-shell-script-474989/)

bv_uma 08-18-2006 12:33 AM

Request : set passwords for many users [user accounts exist] using a shell script
 
I have user accounts[temporary accounts used for conducting quizes] defined in /etc/passwd & /etc/shadow files.

As Administrator, I wish to set password for user accounts [say 100 in number] in bulk using a shell script. The shell script should read input from a text file containing <userid, and password in ascii text> and it should update the /etc/shadow or /etc/passwd file accordingly.

acid_kewpie 08-18-2006 02:01 AM

chpasswd can do various bulk operations, but i'd also suggest trying expect to automate any other detailed aspects if chpasswd doesn't fit in exactly with what you want, but i think it does.

bathory 08-18-2006 03:13 AM

newusers should do the job.
Code:

man newusers
for details.

bv_uma 08-19-2006 09:01 AM

thanks for reply regarding chpasswd for changing user passwords
 
Thanks to Chris for reply
regarding setting passwords for many users using chpasswd.


All times are GMT -5. The time now is 08:44 PM.