How to create multiple users using bash script!!

1 view
Skip to first unread message

naresh

unread,
Sep 24, 2007, 1:15:08 PM9/24/07
to Delhi/NCR Linux Users Group
HI,

First of all create two files one contains username and other
passwords. here i'm using file users as username file and file pass as
password file and script is:

#!/bin/bash
arr=(`cut -f1 users`)
for i in `cat pass`
do
useradd ${arr[$x]};
echo $i|passwd --stdin ${arr[$x]};
x=$[$x+1];
done


enjoy creating users in one go!!

Naresh

Reply all
Reply to author
Forward
0 new messages