954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Create users

Hi
Can anyone help on how to add passwords to already created users non-interactively in shell script.
Passwords will be stored in one text file. Script should automatically take passwords from file.

Thanks in Advance
Vishwajit

vishwajit
Newbie Poster
6 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Hey There,

You can do it if your implementation of passwd accepts input from STDIN. Just run through a while loop, like

while read input
do
    passwd code here
done <input


Hope that helps :)

, Mike

eggi
Posting Pro in Training
400 posts since Oct 2007
Reputation Points: 102
Solved Threads: 47
 

Thanks Eggi

vishwajit
Newbie Poster
6 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Glad to help :)

, Mike

eggi
Posting Pro in Training
400 posts since Oct 2007
Reputation Points: 102
Solved Threads: 47
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You