Youry's Blog

Youry's Blog

CVS server on CENTOS

leave a comment »

updated from Set Up CVS Server on Linux (some mistakes and some problems found)

Assumption: server:   client:
Goal: user mike can use the CVS on (assumption: mike has an account as “mike” on

At the first we need to create users:

in MS Excel

useradd -c <comment> <username> -G cvs

=CONCATENATE(“useradd -c “,LOWER(LEFT(RIGHT(B7,LEN(B7)-FIND(“,”,B7)-1),1)&(LEFT(B7,FIND(“,”,B7)-1))))

change password

=CONCATENATE(“echo “,CHAR(34),LOWER(LEFT(RIGHT(B7,LEN(B7)-FIND(“,”,B7)-1),1)&(LEFT(B7,FIND(“,”,B7)-1))),”:”,E7,CHAR(34),” | chpasswd”)


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 mike to the cvs group:
$usermod -G mike cvs

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

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:

# default: off
# description: The CVS service can record the history of your source \
#              files. CVS stores all the versions of a file in a single \
#              file in a clever way that only stores the differences \
#              between versions.
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 if not in the file:
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 mike (you can keep some lines if needed)
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/mike/myproject onto CVS server:
$cd /home/mike/myproject
$cvs import -m “my project” myproject mike start

12. errors:
1) As follows:
[ ~]$ 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 now:
$setenforce 0

Turn it off after next restart:
$vim /etc/selinux/config
modify SELINUX=enforcing to

2) As follows:
[ ~]$ 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 now:
service iptables stop

Turn off firewall after next restart:
$chkconfig iptables off   # or $/sbin/chkconfig –level 2345 iptables off

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

NOTE: This method applies on Fedora 12 for CVS server

[5]  (CVS 常用操作 Howto)


Written by youryblog

September 28, 2013 at 5:20 PM

Posted in Uncategorized

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: