[CentOS] help - batch account creation

Mon Aug 3 19:31:20 UTC 2009
David Leon <dleon741210 at gmail.com>

I found this

This command is intended to be used in a large system environment
where many accounts are updated at a single time (batch mode). Since
username and passwords are stored in clear text format make sure only
root can read/write the file.

Use chmod command:

# touch /root/batch-user-add.txt
# chmod 0600 /root/batch-user-add.txt

Create a user list as follows. Open file:

# vi /root/batch-user-add.txt

Append username and password:
user1:password:1001:513:Student Account:/home/user1:/bin/bash
user2:password:1002:513:Sales user:/home/user2:/bin/bash
user100:password:1100:513:Sales user:/home/user100:/bin/bash
tom:password:1110:501:Guest Account:/home/guest:/bin/menu
jerry:password:1120:501:Guest Account:/home/guest:/bin/menu

Now create users in batch:

# newusers /root/batch-user-add.txt


On 8/3/09, nate <centos at linuxpowered.net> wrote:
> David Leon wrote:
>> I'm trying to avoid typing every password manually. I just need an
>> script that makes the job.
>>
>> useradd creates the account but still need to setup accpunt's password.
>>
>
> from 'man passwd'
>
>        --stdin
>               This option is used to indicate that passwd should read the
> new password from standard input, which can be a pipe.
>
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>