How to set up CVS Server in Linux

Let us assume following in this article: server:   client:

Goal: user alex can use the CVS on (assumption: alex has an account as “alex” on


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, log in to the CVS server:
$cvs login

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

12. errors:
[ ~]$ cvs -d login
Logging in to
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
Turn it off :
$vim /etc/selinux/config
modify SELINUX=enforcing to

[ ~]$ cvs login
Logging in to
CVS password:
cvs [login aborted]: connect to []:2401 failed: No route to host

Solution: turn off firewall on, 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


About Manish Jha

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in Iono,Inc as Cloud Solutions Architect. I have around 8 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in Linux/CentOS. Bookmark the permalink.

6 Responses to How to set up CVS Server in Linux

  1. 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!


  2. t shirt foot says:

    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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s