[CentOS] help - batch account creation
dleon741210 at gmail.com
Mon Aug 3 19:58:46 UTC 2009
thanks, I will try this, it looks like what I'm looking for
On 8/3/09, a arias <aarias239 at gmail.com> wrote:
> Try this:
> while true
> read username passwd
> if [ "$username" == "" ]
> passwd_hash=$(openssl passwd $passwd)
> echo "Using the following password hash for user "$username":
> /usr/sbin/useradd $username -p "$passwd_hash";
> use the script like this:
> add_multiple_users.sh < /path/to/userlist.txt
> Don't forget to make the script executable:
> chmod +x add_multiple_users.sh
> On Mon, Aug 3, 2009 at 2:56 PM, 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'
>> 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
More information about the CentOS