Last active
August 29, 2015 14:00
-
-
Save metrofx/11362004 to your computer and use it in GitHub Desktop.
Bulk-create linux users with auto-generated password.
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 | |
for userlist in `cat userlist.txt` | |
do | |
user=`echo $userlist | cut -f 1 -d ,` | |
pwd=`echo $userlist | cut -f 2 -d ,` | |
echo "useradd -m -s /bin/bash $user && echo $user:$pwd | chpasswd" | |
done |
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 | |
count=1 | |
while [ $count -le 12 ] | |
do | |
password=`date|md5sum|head -c 8` | |
echo "guestuser$count,$password" | |
((count++)) | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment