How to easily build a CVS server in Linux

Source: Internet
Author: User

CVS is a widely used, open-source, and network-transparent version control system. When using CVS, you must first set up a CVS server, import a project instance to the CVS server, and set up CVS project access control. The customer accesses the CVS server through the client. The customer can obtain a copy of the latest project code and submit the modified Code. The customer can access the CVS server from the Internet, lan, or even the local machine. Next, I will lead you to set up a CVS server in Linux, hoping to help you who want to learn how to set up a CVS server.

1. Download source code

Find the source code package of CVS through the search engine, or search for it from the official CVS website cvshome.org. Due to the history of CVs, some security vulnerabilities have also occurred, therefore, it is recommended to regularly go to its official website to see if the latest version is available.

2. Compile and install

[Root @ Terry SRC] # tar-xjpvf CVS-1.12.5.tar.bz2

[Root @ Terry SRC] # cd CVS-1.12.5

The [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

Run the preceding command to install CVS in the/usr/local/terry_yu/CVS directory.

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

3. Set to start the CVS Service

In Linux, the CVS service can be started through inetd, Xinetd, or tcpwrapper. inetd has been replaced by xinetd for many security reasons. Here we use xinetd to start the CVS service.

In/etc/xinetd. create a configuration file for the CVS service under the d directory, for example:/etc/xinetd. d/cvspserver, edit/etc/xinetd. d/cvspserver, enter the following content:

Service cvspserver

{

Disable = No

Socket_type = stream

Wait = No

User = root

ENV = home =

Server =/usr/bin/CVS

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

}

Note:

1) pserver indicates password-based access. This is the most common access method. Other methods include gserver, kserver, and Ext. For higher security, you can use SSH to encrypt passwords and data streams, however, pserver is selected for user convenience.

2) -- allow-root is the directory of the specified repository. Multiple repository can be created.

Then restart xinetd:

[Root @ Terry bin] #/etc/rc. d/init. d/xinetd restart

Stopping xinetd: [OK]

Starting xinetd: [OK]

After the xinetd service is restarted, the CVS service also starts to work.

4. Create a repository on the CVS server

Create a group named CVs and a user named cvsroot. users who want to access the CVS service will join the group:

[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

In this way, 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

[Root @ Terry root] # chmod-r ug + rwx/home/cvsroot

[Root @ Terry root] # chmod 644/home/cvsroot/config

To ensure the security of the CVS system, modify the/home/cvsroot/config file and remove the comment # Before "# systemauth = No, change "systemauth = No" to "systemauth = No", and create accounts for developers one by one. Do not assign user directories to new accounts because they will be used as a virtual user account. The specific commands are as follows:

[Root @ Terry root] # useradd-g cvs-M bogus

[Root @ Terry root] # passwd bogus

The above command creates a user bogus without the Home Directory, then copies the system shadow file to cvsroot, and rename it passwd:

[Root @ Terry root] # cp/etc/shadow/home/cvsroot/passwd

[Root @ Terry root] # chmod 0644/home/cvsroot/passwd

Then, modify the passwd file, delete all rows except bogus, remove all contents after the second colon in each row, and add the string cvsroot to the file, in the following format:

Bogus: nd5 $ j8n9bw5dkv. npdxfdsh: cvsroot

Then, delete the user bogus you just added in the system:

[Root @ Terry root] # userdel-F bogus

Now, the CVS server has been installed and configured, so that your CVs users can only log on to your CVS server using the users specified in passwd. Note that: the method described in this article applies to a small number of users. If you have a large number of developers, we recommend that you connect to LDAP or database for user authentication.

 
Implement with Perl:
$ Perl-e 'print crypt ("password", "ZZ"), "\ n ";'
Command for generating the CVS User Password
 
$vim ~/.bashrc
 
CVSROOT=:pserver:sahu@127.0.0.1:/home/cvsrootexport CVSROOT
 
$source ~/.bashrc

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.