In combination with documents and some online resources, I want to write a very simple "quick success" teaching material. The following are my steps and practices: Prerequisites:
- Root permission;
- For CVS software, find the related rpm, tgz, deb, and other packages, or
Http://www.cvshome.org/CVS/Dev/code Download the original program compilation and installation. Here I am not going to introduce its installation. Please refer to the CVS documentation for installation. I use the Slackware tgz package. The installation command is # Installpkg cvs *. tgz For other packages, see the command of the corresponding package management tool.
- A certain amount of system resources requires a certain amount of memory (32 MB can work well), a certain amount of disk space, depending on the size and quantity of your project.
Set up a CVS server:
- Create the CVSROOT directoryBecause the user's permission to read and write files in CVSROOT is involved, the simple method isCreate a group, and then create an account that belongs to the groupIn the future, all users with read and write permissions will belong to this group. Assume that we create a group named cvs and the user name is cvsroot. The command for creating the group and the user is as follows:
# Groupadd cvs
# Adduser cvsroot
The generated user home directory is in/home/cvsroot (based on your system)
- Log On with the cvsroot user,Modify/home/cvsroot (CVSROOT) PermissionsGrant the same group the read and write permissions:
$ Chmod 771. (Or 770 should be fine)
Note: This part of work is done according to the instructions in the Document. Do you need to do this without a test? I will make a careful description of the tutorial in a later version after the test. if you have any experience in this area, please provide it to me. Thank you.
- Create a CVS Repository (still the cvsroot user) and run the following command:
$ Cvs-d/home/cvsroot init
- Log in as root and modify/etc/inetd. conf (the system that uses xinetd does not have this file) and/etc/services,
If the inetd system is used, add the following in/etc/inetd. conf: Cvsserver stream tcp nowait root/usr/bin/cvs-f -- allow-root =/home/cvsroot pserver
Note: The above line is a single whole line./usr/bin/cvs should be the command path of your cvs version. Please adjust it according to your system. /home/cvsroot is the path of your CVSROOT. Please make adjustments based on the contents of the Created directory above.
If yesTo use the xinetd system, you must create the file cvspserver in the/etc/xinetd. d/directory (this name can be defined by yourself), The content is as follows:
# Default: on # Description: The cvs server sessions;
Service cvsserver { Socket_type = stream Wait = no User = root Server =/usr/bin/cvs Server_args =-f -- allow-root =/cvsroot pserver Log_on_failure + = USERID Only_from = 192.168.0.0/24 }
WhereOnly_from is used to restrict access and can be modified or not based on actual conditions.. Modify the File Permission:
# Chmod 644 cvspserver
Add the following to/etc/services:
Cvsserver 2401/tcp
Note: cvsserver is an arbitrary name, but it cannot be the same as an existing service. Modify/etc/inetd with the name above. the first entry in the conf line is consistent. here I use the password authentication method of CVS, and other authentication methods of CVS. I have not tried it. If you have experience, please add it. Thank you.
- Add availableCVS service user to cvs Group:
Modify/etc/group as the root user and add the user name that needs to use CVS to the cvs group. For example, if you want laser and gumpwu to use the CVS service, the modified/etc/group should have the following line:
Cvs: x: 105: laser, gumpwu
On your system, GID may not be 105. It doesn't matter. laser and gumpwu should be separated by commas and written after the last colon. of course, if the distribution version such as RedHat has tools such as linuxconf, it will be easier to use tools to do this.
- Restart inetd to make the change take effect:
# Killall-HUP inetd
If xinetd is used:
#/Etc/rc. d/init. d/xined restart
In this way, the server settings are complete. We will proceed to the client. Set the client For Linux (or other * nix), the client and server software are the same. For Windows, MAC, and other platforms, go Http://www.loria.fr/cgi-bin/molli/wilma.cgi/rel Find the corresponding client software. Here I will first talk about how to do it in Linux (* nix:
- Set the environment variable CVSROOT:
$ Export CVSROOT =: pserver: laser @ the_server_name:/home/cvsroot
Note: Here pserver is the access method, and I set password authentication above, so here is pserver. If your CVS server is set to another access mode, you need to modify it accordingly. laser is the user name that can use the CVS server. Here you can modify it according to your settings. In this version, I set the password file of the System user directly, that is to say, laser must be a valid user on the CVS server. Of course, there is a security problem here. CVS can be set as its own user. I will add this content in future versions, you can also provide additional information or read the CVS documentation directly. the_server_name is the name or IP address of the CVS server. Enter/home/cvsroot as the CVSROOT directory of your CVS server based on your CVS server settings or ask the administrator. you can put this line in your shell profile.(. Bash_profile,. Profile, etc.) so you don't have to repeat a long string of commands each time.
- Log on to the CVS server:
$ Cvs loginAt this time, cvs will ask you the password. Please press your password on the CVS server. Here is the password of the System user of laser on the CVS server:
Passwd: xxxxxxxx
After successful login, A. cvspass file will be created in your home directory, and no password will be entered later.
Okay. The client settings are complete.Managing cvs servers The server is ready for use. Now everyone is most concerned about how to manage the server. For example, I want some people to have the permission to read and/or write the CVS repository, but what if I don't want to give it system permissions? It is not difficult. There is a cvsroot directory in the home directory of the cvs Administrator (I am a CVSROOT user), which contains three configuration files: passwd, readers, writers, we can configure the CVS server by setting these three files. The following describes the functions of these files:
Passwd: the user list file of the cvs user. Its format is like shadow file: {Cvs username}: [encrypted password]: [equivalent system username] If you want a user to be a cvs user rather than a system user, you need to set this file. After installation, this file may not exist. You need to manually create it as a cvs administrator, 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 for encryption by yourself, you can also use the lazy method introduced by me: first create a system user, whose name is the same as that of the cvs user. The password is the password that is prepared for the cvs user, after the user is created, copy the second field of the user from/etc/shadow and delete the user. this method is more convenient to deal with a small number of users, so it is not suitable for a large number of users, and there are also potential security risks of conflicting conditions (race condition), and root permissions are required. however, the benefits are nothing more. it is not difficult to write a small program. You can search for it in the Forum programming version. A friend has already written a post on it. The third field is the equivalent system user name. In fact, it is to grant an equivalent system user permission to a cvs user. In the following example, you will understand its functions. Readers: a user list file with cvs read permission. It is a one-dimensional list. In this file, users only have read permission for cvs. [1] [2] Next page |