Creating a Cvs Repository With Pserver Authentication

  • Upload
    kzelda

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

  • 8/7/2019 Creating a Cvs Repository With Pserver Authentication

    1/3

    Linux/Articles/CVS/pserver setup

    Home

    Publications

    Profile(CV)

    Contact

    Money

    Consulting

    Markets

    Stock Tracker

    Java.SCJP

    Java.Links

    Oracle.OCA

    Oracle.OCP

    Linux.Certification

    Linux.Articles

    Process.Agile

    Microcontroller

    Album

    Dictionary

    Impressum

    Creating a cvs repository with pserver authentication

    Step 1Decide a cvs repository location (I use /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 2be root and create a group and add as much users as you require.

    [root@hermes dev]#/usr/sbin/groupadd cvsgrp[root@hermes dev]#/usr/sbin/useradd -c "User Name" -g cvsgrp username[root@hermes dev]#passwd username

    Step 3You have two options. You can move your existing repository from a windows cvs server or

    you can create a new repository.

    Step 3.1If your are moving an existing repository from a windows server set the file and directory

    permissions Your repository (/usr/local/cvsroot) should look like this

    total 1drwxrwxr-x 3 kguclu cvsgrp 2003-05-24 19:25 CVSROOTdrwxrwxr-x 3 kguclu cvsgrp 2003-05-24 19:27 project

    and the files under project directory looks like this

    total 16-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 book2menu.xsl,v-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 document2html.xsl,v-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 site2xhtml.xsl,v-r--r--r-- 1 kguclu cvsgrp 2003-05-24 19:27 tab2menu.xsl,vdrwxrwxr-x 2 kguclu cvsgrp 2003-05-24 19:27 test

    This gives necessary information about the directory permissions. If you are moving your

    files from a windows file system you need to set the permissions manually you can search

    for directories by using the following command under CVSROOT

    find . -type f | xargs ls -l

    this will give you the files and its permissions. There is an example below

    -r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:55 ./project/file1,v-r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:55 ./project/file2,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 20:59 ./project/file3,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 20:59 ./project/file4,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:33 ./project/file5,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file1,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file2,v-r--r--r-- 1 cvs cvsgrp 2003-05-24 21:36 ./project/test/file3,v-r--r--r-- 1 kguclu cvsgrp 2003-05-24 21:57 ./project/test1/file1,v

    so if your stucture doesnot look like the same you should change them appropriately but

    there are some files under CVSROOT directory which has different permissions for that reas

    cvs guide "http://www.cvshome.org/docs/manual/cvs_2.html#SEC13"

    ating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&fi le=linux.cvs.pserver.xml

    r 3 10/02/2011 13:06

  • 8/7/2019 Creating a Cvs Repository With Pserver Authentication

    2/3

    If your repository has different permissions use the following commands in order to set the

    right permissions use

    find . -type d | xargs chmod 775

    to set the directory permissions and use

    find . -type f | xargs chmod 444

    to set the file permissions

    Step 3.2If you are starting up a new project simply use the following to create a new repository from

    scratch.

    cvs -d /usr/local/cvsroot init

    Step 4To inherit the parent directory permission to the newly created sub dirs 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 5Make sure /etc/services contains the line

    cvspserver 2401/tcp

    Step 6Depending on your linux distribution you can may need to edit different configuration files.

    If your system has /etc/inetd.conf edit that file add the following line (only one 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 = noprotocol = tcpsocket_type = streamwait = nouser = root

    server = /usr/bin/cvsserver_args = -f --allow-root=/usr/local/cvsroot pserverpassenv =groups = yes

    }

    Step 7If 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/cvschgrp -R cvsgrp /var/lock/cvs

    ating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&fi le=linux.cvs.pserver.xml

    r 3 10/02/2011 13:06

  • 8/7/2019 Creating a Cvs Repository With Pserver Authentication

    3/3

    chmod -R g+w /var/lock/cvs

    Step 8To test, go to your home directory and enter:

    cvs -d :pserver:cvs@tiger:/cvs logincvs -d :pserver:cvs@tiger:/cvs co .

    Copyright 2002 by Koray Gcl.

    ating a cvs repository with pserver authentication http://www.korayguclu.de/index.php?&fi le=linux.cvs.pserver.xml

    r 3 10/02/2011 13:06