14Aug/12Off
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.#!/bin/bash
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"
done;
« VIM tips
Lightword Theme by Andrei Luca Go to top &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;uarr;