Skip to content

Instantly share code, notes, and snippets.

@adimania
Created March 4, 2013 18:39
Show Gist options
  • Save adimania/5084377 to your computer and use it in GitHub Desktop.
Save adimania/5084377 to your computer and use it in GitHub Desktop.
Script to create hundreds of users in one go.
#!/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