develooper Front page | perl.beginners | Postings from December 2002


Thread Next
Jerry M . Howell II
December 8, 2002 03:18
Message ID:
hello there,

   Got another question. as far as I know I need the following to encrypt
a passwd in perl. I plan to use it to add a users to my /etc/passwd /etc/shadow
and /etc/group now I got a question cuz most newbees do :) what am I missing
in this script I've narowed it down to the crypt command and found out in the
cammel book it should be crypt(plaintext,salt) if I understood it corectly.
what do I need for the salt????
my script is the following (don't laugh to hard :))

print "Enter your preferd username.\n";
$username = <STDIN>;
print "enter your prefered password\n";
$passwd = <STDIN>;
print `/usr/sbin/useradd "$username" -p "$passwd"`;

Jerry M. Howell II

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About