Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

How to install a CVS server (pserver) on Fedora Core 1

by Thomas M. Andersen on Feb 14, 2004 (UPDATED Jun 16, 2004)

Installation (as root)

Use yum to install rpm:

	# yum install cvs
Create a user called cvs:
	# useradd -M -s /sbin/nologin cvs 
Next, create an anonymous user:
	# useradd -M -s /sbin/nologin anonymous
Edit the /etc/group file to add other users to the cvs group (including the anonymous user).
   
    cvs:x:501:tma,anonymous


Configure xinetd (as root)

Create a file called /etc/xinetd.d/cvspserver:

service cvspserver
{
  port = 2401
  socket_type = stream
  protocol = tcp
  wait = no
  user = root
  passenv = PATH
  server = /usr/bin/cvs
  server_args = -f --allow-root=/cvs pserver
}

Restart the xinet daemon:
	# service xinetd restart

Configuration (as root)

Choose a directory for the CVS files (fx. /usr/local/cvsroot/) and set CVSROOT:
	# export CVSROOT=/usr/local/cvsroot/

Create directory and set permissions:
	# mkdir $CVSROOT
# chown -R cvs:cvs $CVSROOT
# chmod ug+rwx $CVSROOT
# chmod o-rwx $CVSROOT
# chmod g+s $CVSROOT

Create a symbolic link. Link matches the "allow-root" in /etc/xinetd.d/cvspserver
	# ln -s $CVSROOT /cvs

Initialize Repository

Login as one of the users in the CVS group and run the following commands:
	$ export CVSROOT=/usr/local/cvsroot/
$ cvs init
Check that a directory called CVSROOT inside your CVS root directory is created.
CVS can use the system /etc/passwd file to authenticate users, but this is not recommended.

Create a file $CVSROOT/CVSROOT/passwd with the format:

    username:crypt_password:run_as_user

Here is a sample $CVSROOT/CVSROOT/passwd file:

tma:qAju16i7iX2Dc:cvs
anonymous::cvs

Tip: Use htpasswd to create encrypted passwords. (Example: htpasswd -n tma)

To limit the anonymous user to read-only access, create a file called $CVSROOT/CVSROOT/readers with the following line:

    anonymous


Test connection from a remote host

Set the CVSROOT for the current user:

	$ export CVSROOT=':pserver:tma@<hostname>:/cvs'

Login to the CVS server:

	$ cvs login

Done. If needed see http://www.cvshome.org for information about how to use CVS.