Linux Gurus?
[TRT]TazAnimal!{*}
tazanimal at rifleteam.com
Wed Dec 22 02:20:06 EST 2004
All:
Being a Linux newbie, I have a Linux / bash script question.
I have a script that I use to set up a server (creates user, sets up their
home folder with cod, etc...). It has one problem though....
When it creates the user, I am unable to correctly set the password and I
have to go back into the user account and reset the password.
Here is the relevant part of script:
#!/bin/bash
userdir=$1
passwd=$2
if [[ $userdir = '' || $passwd = '' ]]
then
echo "Usage mkcod14 <username> <password>"
echo "..."
else
useradd $userdir -c aghostscustomer -g staff -d /home/$userdir -p `echo
"print crypt('$passwd',null);" | perl` -m
...... cut ......
Is there a "correct" way to set the password using crypt that I can't find
on google? :-)
Thanks for any light you can shed.
[TRT]TazAnimal{*}
Brett Stinson
TazAnimal at rifleteam.com <mailto:TazAnimal at rifleteam.com>
More information about the Cod
mailing list