Configure the CVS server in Linux

Source: Internet
Author: User

1. Install the CVS server:
1. Check whether CVS is installed on your operating system:
#> Rpm-Qa | grep CVS

If you have not installed the package, you can find it on the RedHat 2nd discs and download the latest RPM package from the Internet. It is easy to find out, but there is actually no Linux version.

2. Create a CVS user group:

#> Groupadd CVS

3. Create the cvsroot user and directory of the CVS group:

#> Useradd-g cvs-D/cvsroot

4. Add a password for the cvsroot User:

#> Passwd cvsroot

5. Change the Directory attribute of/cvsroot:

#> Chmod-r 770/cvsroot

6. Change User Login identity:

#> Su cvsroot

7. Start to create a single project:

#> Cd/cvsroot
#> Mkdir project1
#> Mkdir project2
8. Start creating a repository:

#> CVS-D/cvsroot/project1 init
#> CVS-D/cvsroot/project2 init
#> Chmod-r 770./project1/./project2/

9. To create a CVS Service Startup File, we use the xinetd method:

#> [Crtl] + [d] switch to the root user identity
#> Cd/etc/xinetd. d
#> VI cvspserver

Service cvspserver
{
Disable = No
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/usr/bin/CVS
Server_args =-f -- allow-root =/home2/cvsroot/project1 -- allow-root =/home2/cvsroot/project2 pserver
Log_on_failure + = userid
}

Note: Due to the length limit of xinetd server_args, you can do this when you want to run many single warehouses:

#> VI cvspserver

Service cvspserver
{
Disable = No
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/cvsroot/CVS. Run
Log_on_failure + = userid
}

Compile the CVS. Run script

#> VI/cvsroot/CVS. Run

#! /Bin/bash
/Usr/bin/CVS-F/
-- Allow-root =/cvsroot/project1/
-- Allow-root =/cvsroot/project2/
Pserver

#> Chmod + x/cvsroot/CVS. Run

10. Join the CVS service:

#> VI/etc/services

Cvspserver 2401/tcp # pserver CVS Service
Cvspserver 2401/udp # pserver CVS Service
11. Start the CVS service:

#>/Etc/init. d/xinetd restart

12. Check whether the cvspserver service has been started:

#> Netstat-L | grep cvspserver
The following results should be returned:

TCP 0 0 *: cvspserver *: * listen

II. User Management of the CVS service:

We have already created two CVS repositories, project1 and project2. Next we will create CVS users for the two repositories respectively.

13. Create a user name and password that can log on to the CVS server:

#> Su cvsroot
#> VI/cvsroot/project1/cvsroot/passwd

Trotter: *****: cvsroot
MIMI: *****: cvsroot

#> VI/cvsroot/project2/cvsroot/passwd

Trotter: *****: cvsroot
GARY: *****: cvsroot

These two files mean three CVS users: Trotter, Mimi, and Gary. Mimi has project1 permission, Gary has project2 permission, and Trotter has project1 and project2 permission. After login, the permission is cvsroot.
Note: The CVS users and system users here are different.

14. * ***** Is the password generated by the following files:

#> VI/cvsroot/passwd. pl

#! /Usr/bin/perl
Srand (Time ());
My $ randletter = "(INT (RAND (26) + (INT (RAND (1) +. 5) % 2? 65: 97 ))";
My $ salt = sprintf ("% C", Eval $ randletter, Eval $ randletter );
My $ plaintext = shift;
My $ crypttext = crypt ($ plaintext, $ salt );
Print "$ {crypttext}
";

#> Chmod A + x/cvsroot/passwd. pl

15. If you want to generate a password of "123456", then:

#>/Cvsroot/passwd. pl "123456"

Press enter to obtain the encryption password, and use it to replace ***** in the passwd file *****

16. OK, CVS has been fully installed. If you want a user to have project1 permissions, add a user to/cvsroot/project1/cvsroot/passwd; if you want a user to have permissions for both project1 and project2, you can add a user with the same user name and password to/cvsroot/project1/cvsroot/passwd and/cvsroot/project2/cvsroot/passwd. Finally, let's try it out:

#> CVS-D: pserver: trotter@192.168.1.200:/cvsroot/project1 Login

After you press enter, the system prompts you to enter the Trotter password. You can enter the password according to your own password. If no error message is displayed, the password is successful (my machine IP address is 192.168.1.200)

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.