Batch process creating new users
tuxradar.com
tuxradar.com
perl -e 'print crypt("password", "salt")
so you would do something like:
useradd -d / -g users -p $(perl -e'print crypt("foo", "aa")') -M -N foo
working example for the site:
cat newusers | while read u p n
do
useradd --comment "$n" --password $(python -c 'import crypt; import os; print crypt.crypt(os.environ.get("p", ""),"salt")') --create-home $u
done
Couldn't get it work with perl:)
cat newusers | while read u p n
do
export p
useradd --comment "$n" --password $(python -c 'import crypt; import os; print crypt.crypt(os.environ.get("p", ""),"salt")') --create-home $u
done