Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Aug 2000 12:49:14 +1000
From:      Tony.Irvine@env.qld.gov.au (Tony Irvine)
To:        Dan Fairs <danfairs@yahoo.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Passwords without passwd... - CVS
Message-ID:  <398F752A.4052A0A2@env.qld.gov.au>
References:  <20000807181112.11772.qmail@web3206.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Fairs wrote:
> Therefore, how does one go about generating passwords oneself, for CVS,
> or any other system password-compatible system?

I am very new to FreeBSD and not near my system so I can not confirm that this
will work but here is the perl script I use to generate crypted passwords. I
hope it is of some help.


#!/usr/local/bin/perl -w

use strict;

srand (time() ^ ($$ + ($$ << 15)));

# Gen a random salt
my $salt = (chr(int(rand 57) + 65)).(chr(int(rand 57) + 65));

print "\n";

while (1) {
   system("stty -echo");
   print "Password:";
   chop(my $word = <STDIN>);
   print "\n";
   print "Again:";
   chop(my $word2 = <STDIN>);
   system("stty echo");
   print "\n\n";
   if ($word eq $word2) {
      print (crypt($word, $salt));
      print "\n\n";
      exit(1);
   }
   else {
      print "ERROR : Your two passwords did not match.\n\n";
   }
}

-- 
Tony Irvine, Project Officer (Web)
Environmental Protection Agency
Tel:(07)3227-7991  Fax:(07)3227-6534


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?398F752A.4052A0A2>