From owner-freebsd-questions Tue Aug 8 4:35: 7 2000 Delivered-To: freebsd-questions@freebsd.org Received: from athserv.otenet.gr (athserv.otenet.gr [195.170.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 209CD37BD06 for ; Tue, 8 Aug 2000 04:35:01 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-b102.otenet.gr [195.167.121.230]) by athserv.otenet.gr (8.10.1/8.10.1) with ESMTP id e78BWil05005; Tue, 8 Aug 2000 14:32:45 +0300 (EET DST) Received: (from charon@localhost) by hades.hell.gr (8.10.2/8.10.2) id e781CDq01766; Tue, 8 Aug 2000 04:12:13 +0300 (EEST) Date: Tue, 8 Aug 2000 04:12:13 +0300 From: Giorgos Keramidas To: Dan Fairs Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Passwords without passwd... - CVS Message-ID: <20000808041213.A1667@hades.hell.gr> References: <20000807181112.11772.qmail@web3206.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000807181112.11772.qmail@web3206.mail.yahoo.com>; from danfairs@yahoo.co.uk on Mon, Aug 07, 2000 at 07:11:12PM +0100 X-PGP-Fingerprint: 3A 75 52 EB F1 58 56 0D - C5 B8 21 B6 1B 5E 4A C2 X-URL: http://students.ceid.upatras.gr/~keramida/index.html Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Aug 07, 2000 at 07:11:12PM +0100, Dan Fairs wrote: > Hi, > > Apologies if this is in the docs, but I've missed it if I have. > > I'm setting up a remote CVS repository, with users authenticated with a > password. I read in the CVS docs that CVS uses the same format as the > FreeBSD master.passwd file - and indeed, copying and pasting the > encrypted password into the appropriate CVS password file results in a > successful login. > > I'd like to know how to generate these passwords without having to go > through the rigmarole of adding a user to the system, copy'n'pasting > the password from the password file, then removing the user again from > the system. I have a small perl script in my $CVSROOT/CVSROOT directory that goes like this: #!/usr/bin/perl # This script is a small tool that can be used to update $CVSROOT/passwd # files, by ommiting pairs of username:password (with password being the # encrypted form of the second command line argument. # # $Id: cvspasswd.pl,v 1.1 2000/07/02 23:28:10 charon Exp $ &usage unless (defined($user = $ARGV[0])); &usage unless (defined($pass = $ARGV[1])); $salt = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]; $crypted = crypt($pass, $salt); print "$user:$crypted:cvs\n"; sub usage { die "usage: cvspasswd USER PASS\n"; } With this script, I can write something like: % perl cvspasswd.pl username password >> ~cvs/CVSROOT/passwd and have the password added for a new user in CVSROOT/passwd. Of course, if the user already exists in CVSROOT/passwd or you don't want to give everyone the same rights as user `cvs' while they're using cvs's :pserver: access method, you might have to edit manually CVSROOT/passwd after this is done. -- Giorgos Keramidas, For my public pgp2 key: finger -r keramida@diogenis.ceid.upatras.gr To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message