Re: help - batch account creation

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



thanks, I will try this, it looks like what I'm looking for


On 8/3/09, a arias <aarias239@xxxxxxxxx> wrote:
> Try this:
>
> while true
> do
>        read username passwd
>        if [ "$username" == "" ]
>        then
>                exit
>        fi
>     passwd_hash=$(openssl passwd $passwd)
>     echo "Using the following password hash for user "$username":
> $passwd_hash"
>     /usr/sbin/useradd $username -p "$passwd_hash";
> done
>
> 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@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxx
>> http://lists.centos.org/mailman/listinfo/centos
>>
>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux