Empulse Group a collection of notes from a sys admin, musician, and father


Here is a small bash script that will create a user from a list that you can pipe it complete with setting and printing a random password. This was for mail users so I set the shell to false.


while read USER; do
   PASS=`< /dev/urandom tr -dc A-Za-z0-9_ | head -c8`
   /usr/sbin/useradd -s /bin/false $USER
   echo $PASS | passwd $USER --stdin
   echo "User: $USER / Pass: $PASS"