[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: useradd and passwd
On Thu, May 10, 2001 at 06:59:43PM -0500, Sanjeev Gupta wrote:
> See attached perl script. Call it with
[snip]
> #!/usr/bin/perl
> # pop_passwd username password >> password file
>
> $name = $ARGV[0];
>
> @salt_chars = ('a'..'z','A'..'Z','0'..'9');
@salt_chars = ('a'..'z','A'..'Z','0'..'9', '.', '/');
> $salt = $salt_chars[rand(62)] . $salt_chars[rand(62)];
$salt = $salt_chars[rand(64)] . $salt_chars[rand(64)];
>
> $passwd = crypt ($ARGV[1], $salt);
>
> print "$name:$passwd\n";
>
bye :)
Anmol