Request : set passwords for many users [user accounts exist] using a shell script
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.