CVS Server Quick Guide

xiaoxiao2021-03-06  16

Introduction CVS is an abbreviation for Concurrent Version System for version management. If you have participated in the projects that have collaborated with many people, everyone must have such a painful experience: Since many people have modified the same document, their own hard-modified procedures are completely deleted by others. Also, if your software / program has released three versions, at this time, the user needs you to modify the second version, maybe you will cry because only the latest version is kept. There is also some modifications to the program, but the modifications are very few, you only want to send a different version of the different versions to the distant colleagues, which can be exempted from the mailbox is not big enough, the network speed is too slow. . In order to solve problems like this, and such as generating patch files, historical version modifications, a bunch of hackers (commendation) has developed CVS based on the Mature SCCS and RCS in the original UNIX system. (SCCS: Source Code Control System, RCS: Revision Control System). The basic work idea of ​​CVS is this: Create a repository on one server, and many source processes of many different items can be stored in the warehouse. The source program is managed by the warehouse administrator. In this way, it seems that only one person is like a file. Avoid conflicts. Each user first uses the warehouse to download the project file in the warehouse to the local. Any modification of the user is first conducted locally, then submitted by the CVS command and is unified by the CVS warehouse administrator. This will do tracking file changes, conflict control, and more. Since CVS is a typical software software, it is also divided into two parts: the server side and the client. However, most CVS software combines them two. We will discuss the use of CVS from the perspective of servers and clients, respectively. CVS server installation first make sure the system is installed with CVS: [root @ mail xinetd.d] # rpm -qa | grep cvs CVS-1.11.1p1-3 If the command output is similar to the above output, the system has already installed CVS, otherwise Need to install the CVS RPM package from the installation CD.

One Crelection CVS Home User: # UserAdd -d / CVSROOT CVS # chmod 771 / CV SROOT 2, CVS Warehouse (Initialization CVS) # SU CVS $ CVS -D / CVSROOT $ EXIT # four, start CVS server in / etc The contents of the file CVSPSERVER in /Xinetd.d/ directory, the contents are as follows: # Default: on # description: The cvs server sessions; service cvspserver {socket_type = stream wait = no user = root server = / usr / bin / cvs server_args = -f --allow-root = / cvsroot pserver log_on_failure = userid online = 192.168.0.0/24} where the only_from is used to limit access, and can be not or modified according to the actual situation. Modify this file permission: # chmod 644 CVSPServer then restart xinetd: # /etc/rc.d/init.d/xined restart and check if the CVS server is running: [root @ mail xinetd.d] # netstat -lnp | grep 2401 TCP 0 0 0.0.0.0:0:2401 0.0.0.0:0:8 Listen 7866 / xinetd The CVS server has been run. 5. Creating CVS users created in front of users who visit CVS are CVS warehouse management users, and to let users access, you need an access to users: # ueradd cvspub # UseMod -g CVS CVSPUB Add a user CVSPUB, and will This user is added to the CVS group. 6. Manage CVS Server Management CVS Server. The server can be used, and now everyone is most concerned how to manage the server, for example, I want some people to read and / or write the permissions of the CVS warehouse, but don't want to give it system permissions? It is not difficult, after the end of CVS initialization, there is a cvsroot directory in the main directory of the administrator user (here is the CVS user). There are three profiles in this directory: Passwd, Readers, Writers.

We can configure the CVS server by setting these three files. The following is introduced to the role of these files: Passwd: CVS user list file, its format is very like shadow file: {CVS username}: [Encryption password ]: [Equivalent System User Name] If you want a user just a CVS user, not a system user, then you have to set this file, then this file may not exist after you have installed, you need to be CVS administrator (SU CVS) The user is created manually, of course, according to the above format; the second field is the user's encrypted password, which is encrypted with Crypt (3), you can write a program to make encryption, or two lazy methods : First create a system user, name, and CVS users, the password is ready to give it the CVS user password, copy the second field from / etc / shadow from / etc / shadow, then remove this user. This method is relatively convenient to deal with fewer users, and people are not suitable, and there is also a safety hazard of conflict conditions, and Root privileges, it is really not good, but the equivalent is another method. That is to use the apche's htpasswd command to create a passwd user, add users only need htpasswd passwd username to add users to the Passwd file, but need to add a final addition to the end in the file ":" colon and corresponding equivalent system username; The best is to write a program to generate this Passwd file. The third field is an equivalent system username. In fact, it is to assign an equivalent system user with a CVS user. Look at the following example you understand its function. Readers: A user list file with CVS read rights is a one-dimensional list. Users in this file have only read permissions for CVS. Writers: The list of users with CVS write permissions, like Readers, is a one-dimensional list. Users in this file have write access to CVS. The above three files may not exist when the default installation, you need to create it yourself, ok, now let us use an example to teach. Suppose we have the following users need to use CVS: CvSuser1, CvSuser2, Henry, Betty, Anonymous, Laser and Gumpwu are system users, and Henry, Betty, Anonymous we don't want to give system user privileges, and Betty and Anonymous are read-only. User, and Anonymous is even more than one password. Then edit cvs administrator home directory CVSROOT / passwd file, you add the following lines: laser: $ xxefajfka; faffa33: cvspubgumpwu: $ ajfaal; 323r0ofeeanv: cvspubhenry: $ fajkdpaieje: cvspubbetty: fjkal; ffjieinfn /: cvspubanonymous :: cvspub Note: The second field above (separator is :) is a secret text password, you want to use the program or use my dirt. Edit the readers file, add the following line: AnonymousBetty Edit the Writer file, add the following line: LaserGumpWuhenry is OK, you will use several users to log in to test, I will find everything OK.

转载请注明原文地址:https://www.9cbs.com/read-45118.html

New Post(0)