Beginner's level: detailed explanation of the quick configuration process for CVS

Source: Internet
Author: User
Article Title: Beginner advanced: detailed explanation of the quick-to-configuration process for CVS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Many documents about the installation and setup of the CVS server are available on the Internet, but there are few documents on how to manage the CVS server skills.
  
I have encountered a situation where multiple databases are needed to share a CVS server. The requirement is that the CVS permissions of each database are separated and cannot be accessed from each other. In this way, the cross-permission is displayed. How do I assign permissions? In this document, I mainly want to explain how to use CVS multi-warehouse (Multi-cvsroot) to separate and cross permissions.
  
This document is very practical. I have established many CVS and it is easy to follow the steps below, what's more, I hope it will be helpful to you. I also have some tips and experience, and I will 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-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 the user login identity:
  
#> Su cvsroot
  
7. Start to create a single project:
  
#> Cd/cvsroot
  
#> Mkdir project1
  
#> Mkdir project2
  
8. start to build a warehouse:
  
#> Cvs? D/cvsroot/project1 init
  
#> Cvs? D/cvsroot/project2 init
  
#> Chmod? R 770./project1/./project2/
  
9. Create the 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 permissions for project1, you can 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: the email address has been hidden by the Anti-Spam function. You need to enable the Javascript function to see it. :/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.