[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to batch-add user accounts?



On Wed, Apr 18, 2007 at 09:47:16AM -0500, Kent West wrote:
> My googling skills must be getting rusty, as I'm not finding my answer ...
> 
> Is there an easy method to add 30 or 300 user accounts to an Etch system?
> I'm thinking in terms of having a flat text file that looks something like:
> 
> user1,passwd1,room,phone,blah,blah,blah
> user2,passwd2,room,phone,blab,blah,blah
> etc...
> 
> that I can feed to an "adduser"-type of utility.
> 

adduser is an interactive front-end to useradd.

Create a file that has the command-line arguments to useradd, one user
per line.  cat this file, pipe to xargs and xargs will run useradd once
for each line passing the line to the useradd command.

Read the xargs man page to get the options right and do a small-run
test.

Doug.



Reply to: