Use CVS to configure multiple users

Source: Internet
Author: User

 

CVS is currently the most common version control and software configuration system. Its open-source nature is indispensable in its popularization. However, it is caused by open-source that it is easy to use. A function can be implemented only through several seemingly unrelated operations. In Windows, the multi-account configuration of CVS is very important, but it is not easy to operate. Several difficulties are as follows:

  1. CVS originated from Unix systems, and its portable version of Windows does not have server functions. In Windows, the cvsnt software is usually used to establish cvs repository, but the cvsnt operation method is slightly different from the original CVs.
  2. CVS itself is a command line form, and its configuration process is complicated.
  3. For multi-account configuration of CVs, You need to manually modify the files in the cvsroot folder of repository, which lacks a unified interface.

After the cvsnt server is installed, the default user is to create a login account for the repository Windows system, but when many people develop, no one wants everyone to use the same name for commit; more importantly, we may need to configure developer permissions. For example, to restrict some people to view programs only, some people can commit programs, and some people can add new modules. The following are detailed steps. The environment is cvsnt 2.5.03 (build 2151) + tortoisecvs 1.8.25:

1. Create a repository using cvsnt. Assume that the administrator password of Windows is used for Logon. repository uses the pserver protocol. The IP address is 1.2.3.4, the port number is 2401, the repository name is/testrep, And the password is 123. The Administrator is also the repository administrator.

2. to configure multiple users, you must modify several files in the cvsroot directory of repository. First on the client, set: pserver: administrator@1.2.3.4/testrep to the cvsroot environment variable (note that the cvsroot directory and cvsroot environment variables are distinguished ). Log on to CVS with administrator and check out the cvsroot directory. The command is as follows:

CVS Login
// Enter password 123
CVS Co cvsroot

3. Add a Windows account dedicated to CVS operations to windows on the server side. All CVS accounts must be mapped to this Windows account for actual operations. Although many documents did not mention the need to create a Windows account, but I found that this account is not in use in my experiment, CVs will report errors without this account when performing any operations later. Assume that the new account is cvsuser. Use Windows commands

Net user cvsuser cvsuserpassword/Add

You can add this account. After adding the cvsuser permission, remember to add/testrep to the actual folder permission on the server, otherwise, any CVS account mapped to the cvsuser will not be able to perform the normal commit operation because it has no write permission. First, find "Folder Options" in the "Tools" menu in the resource manager on the server, and find the "use simple folder sharing" project in the "View" tab that appears later, deselect the preceding check box and click OK. Right-click the/testrep folder and click Properties ". The "security" tab is displayed in the subsequent dialog box. We need to add the read and write permissions of cvsuser here.

4. add your own account for CVs. By using the command CVS passwd, we can add any number of CVS accounts (of course, only for the current repository ). All account information is stored in the passwd file in the cvsroot directory. However, this file cannot be checked out. It can only be seen on the server, and its Stored Password information is encrypted. We can add users such as cvsadmin, user1, user2, and anonymous. For example, the command for adding cvsadmin is:

CVS passwd-a-r cvsuser cvsadmin
// Enter the cvsadmin Password
// Enter the cvsadmin password again

In this way, the cvsadmin account is added and mapped to the Windows Account cvsuser (-A indicates adding an account, and-R indicates copying to the operating system account. I want to use cvsadmin as the Postmaster of/testrep. This is 01:10. If this parameter is not set, after changing CVS to "only use CVS Account Verification Mode", there is no chance to add an administrator (because only the administrator can view and operate the cvsroot directory ).

5. Set cvsadmin as the CVS administrator. Add a new file named admin under the cvsroot directory of the client. Write the account name of each CVS account to be promoted to the administrator in the file, with one account name per line. Of course, the promotion of cvsadmin takes effect only when the admin file is put on the server. However, submitting the admin file does not work. Before submitting it, you must add the admin information to the checkoutlist file. The format of checkoutlist is described in the file. It is a carriage return error message in the format of "Space File Name Space ". Add a record in it:

Admin adminerror

Note that a space must be left before admin.

6. when the new CVS administrator and account information are ready, you need to change the/testrep Account Verification Mode from "Operating System Integration Verification Mode" to "only use CVS Account Verification" mode. This avoids the trouble of Operating Windows accounts to use multiple users in CVS. The configuration file in the cvsroot directory. Open the config file of the client and change # systemauth = yes to systemauth = No (note that there is no space before systemauth after # is deleted ). Save the config file after modification.

7. Submit all updates in cvsroot to the server, and our settings will take effect. The command is as follows:

CD cvsroot
CVS add-M "" Admin
CVS commit-M ""

However, before submission, you may want to change the cvsroot owner from the original administrator to cvsadmin. Use the command CVS chown to do this. After the cvsroot directory is submitted, the verification mode changes immediately and the cvsadmin takes effect at the same time. In this case, CVS cannot be used as the administrator. Use the cvsadmin account to log on again and continue the following operations.

8. Modify the read/write permissions. CVS has two methods to set read and write permissions. One is coarse-grained and the other is fine-grained. Only the CVS administrator can modify the access permissions. The coarse-grained method is to add readers or writers files to cvsroot. Any account added in readers only has read permission on the current database. The format of adding an account is one account name per row. For example, we add the readers file to the cvsroot directory of the client, put anonymous, a new account, and then commit the readers file to the server. Anonymous cannot perform commit. The actual test result is to execute the commit command after logging in with anonymous, and the system reports that the execution is completed normally. But in fact, nothing is committed, exposing the imperfection of CVS in the human-machine interface. The operations on the writers file are the same as those on readers. If an account name is simultaneously written to two files, this account has only read-only permission. The fine-grained method is to use the chacl command. For example, there are three projects in/testrep: project1, project2, and project3. Run the following command:

CVS chacl-u user1-a none-D project1, project2, project3
CVS chacl-u user1-a all-D project1
CVS chacl-u user1-a read, write-D project2
CVS chacl-u user1-a read-D project3

This allows user1 to have full control over the project1 directory, read and write permissions to the project2 directory, and read-only permissions to the project3 directory. The first command First deletes all permissions of user1, and three different directory permissions are set in the subsequent three commands.

9. Use an account group to organize accounts. Add a group file under the cvsroot directory of the client. The format of this file is:

Group name 1: username 1, username 2, username 3 ,......
Group name 2: User name 5, user name 7 ,......
......

After modifying the group file, commit it and use the chacl command to modify group permissions.

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.