Easily build CVS server in Linux environment

  

CVS is a widely used, open source, transparent network version control system. When users use CVS, they must first set up a CVS server, import project instances on the CVS server, and set CVS project access control. The client accesses the CVS server through the client, the client can obtain the latest code copy of the project, submit the modified code, etc., and the client can access the CVS server from the Internet, LAN or even the machine. Below, I will lead you to set up a CVS server in the Linux environment, hoping to bring some help to friends who want to learn CVS server setup.

1. Download the source code

Find the CVS source code package through the search engine, you can also find it from CVS's official website cvshome.org. Because of some security vulnerabilities in CVS history, Therefore, it is recommended to go to its official website regularly to see if there is a new version available.

2, compile and install

[root@terry src]# tar -xjpvf cvs-1.12.5.tar.bz2

[root@terry src]# cd cvs -1.12.5

[root@terry cvs-1.12.5]# ./configure --prefix=/usr/local/terry_yu/cvs

--disable-server-flow- Control

[root@terry cvs-1.12.5]# make

[root@terry cvs-1.12.5]# make install

The above instructions will install CVS to /usr/local/terry_yu/cvs on this directory.

Note: In addition to using the source package for installation, you can also use the RPM package to install.

3, set to start CVS service

On Linux, CVS service can be started by inetd, xinetd or tcpwrapper, etc., inetd has been replaced by xinetd in many occasions for security reasons, here We use xinetd to start the CVS service.

Create a configuration file for the CVS service in the /etc/xinetd.d directory, for example: /etc/xinetd.d/cvspserver, edit /etc/xinetd.d/cvspserver, and enter the following:

service cvspserver

{

disable = no

socket_type = stream

wait = no

user = root< Br>

env = HOME=

server = /usr/bin/cvs

server_args = -f --allow-root=/home/cvsroot pserver

}

Note:

1) pserver means password access, this is the most common way, other gserver, kserver, ext, if you want higher security You can use ssh to encrypt passwords and data streams, but for the convenience of the user, you still choose pserver.

2)--allow-root is the directory of the specified Repository, you can create multiple Repository

and then restart xinetd:

[root@terry bin]# /etc /rc.d/init.d/xinetd restart

Stopping xinetd: [ OK ]

Starting xinetd: [ OK ]

After restarting the xinetd service, the CVS service is also I started working. A total of 2 pages.

4, on the CVS server side to build Repository

First create a group named cvs and a user named cvsroot, users who want to access the CVS service in the future to join the cvs group: Br>

[root@terry root]# groupadd cvs

[root@terry root]# useradd -g cvs -s /sbin/nologin cvsroot

[root@terry root] # chown -R cvsroot /home/cvsroot

Next, initialize:

[root@terry root]# cvs -d /home/cvsroot init

This is /The CVSROOT directory is generated in the home/cvsroot directory, which stores some configuration files, such as config, and then sets permissions:

[root@terry root]# chown -R cvsroot.cvs /home/cvsroot< Br>

[root@terry root]# chmod -R ug+rwx /home/cvsroot

[root@terry root]# chmod 644 /home/cvsroot/CVSROOT/config

For the security of the CVS system, we need to modify the /home/cvsroot/CVSROOT/config file and remove the comment # in front of "#SystemAuth =no", which is changed to "SystemAuth =no" and then to the developers. Create an account one by one, do not assign a user directory to the new one, because it will be used as a virtual user account, such as:

[root@terry root]# useradd -g cvs -M bogus

[root@terry root]# passwd bogus

The above command creates a user bogus that does not have a Home directory, then copies the system's shadow file to CVSROOT and renames it to passwd:

[root@terry root]# cp /etc/shadow /home/cvsroot/CVSROOT/passwd

[root@terry root]# chmod 0644 /home/cvsroot/CVSROOT/passwd
< Then modify the passwd file, delete all lines except bogus, then remove everything after the second colon of each line, and add the string cvsroot to the following format:

bogus:ND5 $J8N9BW5DKV.nPdxfdsh:cvsroot

Then, delete the user bogus that was just added to the system:

[root@terry root]# userdel -f bogus

Now, here, the CVS server has been installed and set up, so your CVS users can only use p The user specified in asswd logs in to your CVS server. It should be noted that the method of adding users described in this article is applicable to a small number of users. If there is a large-scale developer, it is recommended to use LDAP or database to connect users. Certification service.

Copyright © Windows knowledge All Rights Reserved