Date: Tue, 8 Aug 2000 04:12:13 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Dan Fairs <danfairs@yahoo.co.uk> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Passwords without passwd... - CVS Message-ID: <20000808041213.A1667@hades.hell.gr> In-Reply-To: <20000807181112.11772.qmail@web3206.mail.yahoo.com>; from danfairs@yahoo.co.uk on Mon, Aug 07, 2000 at 07:11:12PM %2B0100 References: <20000807181112.11772.qmail@web3206.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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, <keramida@ceid.upatras.gr>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000808041213.A1667>
