How to install CVS/CVSNT server on RHEL /CentOS

First you’ll have to check /etc/services for the definitions of the CVS used TCP ports :

grep -i cvs /etc/services
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations

Then you’ll have to install either CVS package either CVSNT package :
yum install cvs
rpm -ivh cvsnt-

Now, set up users that will access the CVS server :
vim /etc/passwd
vim /etc/shadow

Then, setup a folder for the CVS data. I usually put this on an NFS share which is on a filer so that data is backuped and you have snapshots of it :
mkdir /home/cvsrepo
cvs -d /home/cvsrepo init
chgrp GID /home/cvsrepo (according to what you did in the /etc/passwd)
chmod g+w /home/cvsrepo

Now add the CVSROOT environement variable to all the users needed :

echo "export CVSROOT=/home/cvsrepo" >> /root/.bashrc
echo "export CVSROOT=/home/cvsrepo" >> /home/userXXX/.bashrc

Now time for setup the CVS server. It will be launched by Xinetd, so check you have it running on your system. It is running default on CentOS5, RHEL5, Suse, …
/etc/init.d/xinetd status
It’s Xinetd who will launch CVS each time a client is asking. This is configured in the /etc/xinetd.d folder; you’ll have to add a file like this one :
cat /etc/xinetd.d/cvspserver
service cvspserver
disable = no
socket_type = stream
wait = no
user = root
group = systeme
log_type = FILE /var/log/cvspserver
protocol = tcp
env = '$HOME=/usr/local/cvspserver'
log_on_failure += USERID
port = 2401
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvsrepo pserver

Now restart you xinetd, and check you /var/log/messages that your new rule cvspserver has been loaded :
/etc/init.d/xinetd restart
cat /var/log/messages

Everything is now ok, your CVS server is up. Supposing you created a user named ‘user1’ on the cvs server named ‘cvsserver’ here is the CVSROOT you’ll have to use either on UNIX systems, either on Windows with TortoiseCVS or another CVs client :
For security reasons, it’s possible to create CVS ONLY users. For that, go to the CVS folder and CVSROOT then. At this place there is a “CVS local passwd” alose named passwd. To add users able only to access the CVS and no the entire system, use htpasswd command or perl scripts :
htpasswd passwd user3

Have fun !

One thought on “How to install CVS/CVSNT server on RHEL /CentOS”

  1. HI.
    Thanks a lot for your guide , today i have seen tree guide , this is the better. = for e.g this guide don’t have setitng repository.
    I have the question, why on my centos 5.6 i have xinitd.d on etc/xinit.d/ , i’m tryng to edit etc/init.d/xinit but don’t found it .

    The last question is , why the other guide says this :
    service cvspserver
    disable = no
    socket_type = stream
    wait = no
    user = cvs
    group = cvs
    log_type = FILE /var/log/cvspserver
    protocol = tcp
    env = ‘$HOME=/home/cvsroot’
    bind =
    log_on_failure += USERID
    port = 2401
    server = /usr/bin/cvs
    server_args = -f –allow-root=/home/cvsroot pserver

    Thanks a lot

    See you

    Sorry for my badly english

Leave a Reply

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image