Thursday, February 14, 2013

Shell script to create multiple users


cat  useradd.sh

#!/bin/sh

for i in `more userlist`
do
echo $i
useradd $i
echo tester!23 | passwd $i --stdin
echo; echo “User $username’s password changed!”

done

Create a file userlist and specify the username you would like to create the user account and run the above script. Then the user account are created with the default password 'tester!23'

No comments: