Home > CVS > How to create a cvs repository with pserver authentication

How to create a cvs repository with pserver authentication

Below 6 step tutorial to create a CVS repository
and adding pserver authentication.
Step1.

Decide a cvs repository location e.g. “/usr/local/cvsroot” and

set your CVSROOT variable. It is a good idea to

set this in a bash startup file e.g. /etc/profile

export CVSROOT=/usr/local/cvsroot

Step 2

With  root user, create a group and add any nuber of users.

[root@server ~]#/usr/sbin/groupadd cvsgrp
[root@server ~]#/usr/sbin/useradd -c “username” -g cvsgrp username
[root@hermes dev]#passwd username

Step 3

To start a new project simply use the following to create a new repository.

cvs -d /usr/local/cvsroot init

Step 4
To inherit the parent directory permission to the newly created

subdirs use chmod g+s to set the SGID bit of the directory.

Use the following command to set the SGUID bit of sub directories

find . -type d  | xargs chmod g+s

Step 5
Make sure /etc/services contains the line

cvspserver 2401/tcp

Step 6
Edit /etc/inetd.conf  file and add the following line

and restart inetd by “killall -HUP inetd”

cvspserver stream tcp nowait root /usr/bin/cvs cvs
–allow-root=/usr/local/cvsroot pserver

if you donot have /etc/inetd.conf

this means that your linux distribution uses xinet.d

create /etc/xinet.d/cvspserver file

and Inside that file paste the following and restart your xinetd:

service cvspserver
{
disable     = no
protocol    = tcp
socket_type = stream
wait        = no
user        = root
server      = /usr/bin/cvs
server_args = -f –allow-root=/usr/local/cvsroot pserver
passenv     =
groups      = yes
}

Step 7
If you skip or forget that step you get the following message

cvs server: failed to obtain dir lock in repository /usr/local/cvsroot

In order to fix this problem edit CVSROOT/config and add the following

LockDir=/var/lock/cvs

create a cvs lock directory and set the permission of the directory,

allow write access to the group members

mkdir /var/lock/cvs
chgrp -R cvsgrp /var/lock/cvs
chmod -R g+w /var/lock/cvs

Advertisement
Categories: CVS Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.