Sunday, April 17, 2005

Setting up CVS initially

1)start a repository

cvs -d /usr/local/newrepos init

2)add group cvs

groupadd cvs

3)edit /etc/group and add any user who need to access repository to this group, e.g.

cvs:*:105:david,dahveed

4)group ownership and permissions to repository directory

cd /usr/local/newrepos
chgrp -R cvs .
chmod ug+rwx . CVSROOT

Setting up the CVS password server (pserver)

cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/home/david/cvsroot --allow-root=/home/david/cvsmisc pserver

If you want to make the same work under xinetd, you save a config file in /etc/xinetd.d called cvspserver, (where the last line tells it the names of your repositories):
service cvspserver
{
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /usr/bin/cvs
server_args = --allow-root=/home/pauljohn/cvsroot --allow-root=/home/pauljohn/cvsmisc pserver
}

5)
create /usr/local/newrepos/CVSROOT/passwd (for people who don't have a system account and if you want a diff password for the user)

format = username:encrypted_password:optional_system_username

use passwd to create password and paste into CVSROOT/passwd

Better- use the folowing perl script to generate the password

==========

#!/usr/bin/perl

srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);

print "${crypttext}\n";

=========

./cryptout.pl "password_in_plain_text"


[root@server lin]# cvs -d :pserver:david@localhost:/usr/local/repository login
(Logging in to david@localhost)
CVS password:

cvs import -m "Initial my_apps import" apps davd start
Post a Comment