Let us assume following in this article: server: server.example.com   client: client.example.com

Goal: user alex can use the CVS on server.example.com (assumption: alex has an account as “alex” on server.example.com)

Steps:

1. install cvs and xinetd on the server
$yum install cvs
$yum install xinetd

NOTE: check whether cvs (or xinetd) has been installed:
$rpm -qa | grep cvs

2. set up cvs group and user on the server:
$groupadd cvs
$useradd -g cvs -G cvs -d /home/cvsroot cvsroot
$passwd cvsroot # set up password for cvsroot

Add alex to the cvs group:
$usermod -a -G alex cvs

Check whether alex is in the cvs group:
$groups alex

3. change owner of /home/cvsroot if necessary, chmod for /home/cvsroot:
$chown -R cvsroot:cvs /home/cvsroot
$chmod -R 775 /home/cvsroot

4. initialize cvs:
(login as cvsroot)
$cd /home/cvsroot
$cvs -d /home/cvsroot init  # full path is required
$chmod 644 /home/cvsroot/CVSROOT/config

5. create file for CVS self-startup, as xinetd type
(login as root)
$cd /etc/xinetd.d
$cp cvs cvspserver
$vim cvspserver  # do the following modifications:

service cvspserver
{
disable                 = no             # modify
port                       = 2401
socket_type       = stream
protocol               = tcp
wait                       = no
user                       = root
passenv               = PATH
server                   = /usr/bin/cvs
env                         = HOME=/home/cvsroot    # modify
server_args        = -f –allow-root=/home/cvsroot pserver    # modify
}

6. add CVS as a service:
$vim /etc/services

Add two lines :
cvspserver 2401/tcp #pserver cvs service
cvspserver 2401/udp #pserver cvs service

7. restart xinetd:
$/etc/init.d/xinetd restart

8. check if cvspserver has started
$netstat -l |grep cvspserver

should return:
tcp   0    0            *:cvspserver           *:*               LISTEN

9. manage users
$cp /etc/shadow /home/cvsroot/CVSROOT/passwd   # owner of passwd should be cvsroot:cvs
$cd /home/cvsroot/CVSROOT
$chmod 644 passwd

modify passwd, delete all lines except users cvsroot and alex
for every line, delete all the content after the second “:”, and append cvsroot to that “:”

10. on client client.example.com, log in to the CVS server:
$export CVSROOT=:pserver:alex@server.example.com:2401/home/cvsroot
$cvs login

11. on client client.example.com, import a project /home/alex/myproject onto CVS server:
$cd /home/alex/myproject
$cvs import -m “my project” myproject alex start

12. errors:
1)
[alex@client.example.com ~]$ cvs -d :pserver:alex@server.example.com:/home/cvsroot login
Logging in to :pserver:alex@server.example.com:2401/home/cvsroot
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs pserver: cannot open /home/cvsroot/CVSROOT/config: Permission denied

Solution: turn off SELinux on server.example.com.
Turn it off :
$vim /etc/selinux/config
modify SELINUX=enforcing to
SELINUX=disabled

2)
[alex@client.example.com ~]$ cvs login
Logging in to :pserver:alex@server.example.com:2401/home/cvsroot
CVS password:
cvs [login aborted]: connect to [server.example.com]:2401 failed: No route to host

Solution: turn off firewall on server.example.com, or allow 2401 port in the firewall
Turn off firewall :
$service iptables stop

Turn off firewall after next restart:
$chkconfig iptables off

Check firewall status:
$/etc/init.d/iptables status

Posted in: Linux.
Last Modified: October 31, 2013

6 thoughts on “How to set up CVS Server in Linux

  1. bottes bocage 2010

    This is a quite great article, I think there will be a lot of men and women. like it, of system, I was one of the men and women. I think this write-up. improve my knowledge. Thank you!

    1. alexhunt Post author

      Guys like you motivate me to write more and more articles which can be useful for people all round the globe.

  2. t shirt foot

    I actually recognize the data you confirmed there. Maintain performing what youa??re undertaking. Methods like the 1 you mentioned below is quite valuable.

  3. Pingback: bottes regard ristul

Leave a reply