Created
March 4, 2013 18:39
-
-
Save adimania/5084377 to your computer and use it in GitHub Desktop.
Script to create hundreds of users in one go.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo This script requires super user permissions. Press \'y\' if you are running as super user. | |
read ch | |
count=$1 | |
if [ $ch = "y" ] || [ $ch = "Y" ] | |
then | |
echo in if now | |
while [ $count -ne 0 ] | |
do | |
echo Adding User $count | |
useradd user$count | |
echo userpwd$count | passwd --stdin user$count | |
let "count=$count-1" | |
done | |
else | |
echo Please run the script as super user. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment