From: "Mikevl" <[EMAIL PROTECTED]>
> Hi can anybody tell me how to bulk add users from a text file or any other
> method?
> I currently have Redhat 7.2

Should be relatively easy with a for/do loop in a little script or something. Say you 
have a file called $HOME/users.txt with just names in, in the format:

groucho
harpo
chico

Doing something like: 

# for NAME in `cat $HOME/users.txt`
> do
> useradd $NAME
> done

... would add groucho, harpo and chico with the default useradd options, man useradd 
or run it with no parameters to see what options you have available. 

Expect comes with a handy script called autopasswd which would allow you to add 
passwords for these users too (plain old passwd is interactive, making it tricky to 
automate). 

Will.




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to