On Thu, 10 May 2001, Vivek Chawla wrote:

> But how do I generate that encrypted password from a simple password in a
> shell script or a perl script.
> 
> The crypt function mentioned is a c library function ?

See attached perl script.  Call it with
        ./mkpasswd username passwd

--
Sanjeev "ghane" Gupta                    Mob: +65 98551208
dotXtra Pte Ltd                          Fax: +65 2275776
Singapore                                email: [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl
# pop_passwd username password >> password file

 $name = $ARGV[0];

 @salt_chars         = ('a'..'z','A'..'Z','0'..'9');
 $salt               = $salt_chars[rand(62)] . $salt_chars[rand(62)];

 $passwd = crypt ($ARGV[1], $salt);

 print "$name:$passwd\n";

------------------------------------------------
An alpha version of a web based tool to manage
your subscription with this mailing list is at
http://lists.linux-india.org/cgi-bin/mj_wwwusr

Reply via email to