This article mainly tells the installation and configuration of the CVS server. For information on the CVS client, please see TortoiseCVS or WinCVS:
1. Verify that CVS # rpm -q cvs have been installed if you can display version information like this, demonstrate that CVS is installed: # cvs-1.11.2-10
2. Create a CVS user group to perform the following: #groupadd cvs # adduser cvsroot # adduSer cvsroot #
# Enter the cvsroot user password
3. Create cvsrootroot users to perform: #mkdir / var / cvsroot This can be changed to the CVSROOT path of you want #Chown CvsRoot.cvs / var / cvsroot Change CVSROOT permissions
4, initialization CVS needs to execute under cvsroot users #SU - cvsroot # cvs -d / var / cvsRoot init This CVSROOT path created above) CVSROOT path # Note: Configuration of the corresponding back /etc/xinetd.d/cvspserver file
5. Modify environment variable # can change the editing / etc / profile or / home, the corresponding user is modified / etc / profile as an example: #EXIT Returns to the root user, only root users have permission modification / etc / profile
#vi / etc / profile editing / etc / profile file plus the following two sentences:
Cvsroot = / var / cvsrootexport cvsroot
Update environment variable: #. / Etc / profile This system has recognized the environment variables like $ cvsroot
6, start the CVS server: Create a file CVSPServer in the /etc/xinetd.d/ directory, as follows: # Default: on # Description: The cvs server sessions;
Service cvspserver {socket_type = streamwait = Nouser = rootserver = / usr / bin / cvsserver_args = -f - allowow-root = / var / cvsroot pserver # Note, the corresponding fourth step cvs -d / var / cvsRoot init command only_from = 192.168 .10.0 / 24}
The only_from is used to restrict 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/xinetd rest and check if the CVS server is running: # netstat -lnp | grep 2401tcp 0 0 0.0.0.0:0:2401 0.0.0.0:8 Listen XXXXXX / XINETD The CVS server has been run.
7, establish CVS users
For the security of the CVS system, we want to modify the / var / cvsroot / cvsroot / config file, remove the "#systemauth = no", "#SystemAuth = no", then change to developers one by one Establish an account, newly built do not assign a user directory, because it will be used as a virtual user account, specific commands such as [root @ Terry root] # chmod -r ug rwx / var / cvsroot [root @ Terry root] # chmod 644 / var / cvsroot / cvsroot / config [root @ Terry root] # UserAdd -g cvs -m bogus [root @ Terry root] # Passwd Bogus The above command creates a user BOGUS that does not have a Home directory, then Shadow files are copied to CVSROOT and renamed to Passwd:
[root @ Terry root] # cp / etc / shadow / var / cvsroot / cvsroot / passwd [root @ Terry root] # chmod 0644 / var / cvsroot / cvsroot / passwd
Then modify the passwd file, remove all the keys you just set with the CVS user cvsroot and bogus, then remove all the contents of each row after the second colon, and add string cvsroot, change to the following format:
[root @ Test11 CVSROOT] # More Passwd Cvsroot: $ 1 $ H3NTACE9 $ CM2SADTO6B9P5H5WRBGYI.: CVSROOT BOGUS: $ 1 $ 2TTSJV9A $ 5K.ZZZZHHLQZNZPGEE8F1: CVSROOT
Then, delete the user bogus that is just added to the system:
[root @ Terry root] # Userdel -f Bogus
Ok, to this, the CVS server is configured to complete. At this point your CVS users can only log in to your CVS server with users specified in Passwd.
8, Linux client login test
Assume that the CVS server is on 192.168.10.11, there are users cvsroot and Bogus on the system. Log in to another Linxu machine, perform the following command to complete the test:
[root @ Test2 Test] # export cvsroot =: pserver: cvsroot@192.168.10.11: 2401 / var / cvsroot [root @ Test2 test] # cvs login logging in to: pserver: cvsroot@192.168.10.11: 2401 / var / cvsrootcvs Password: # Note: Enter the password, no error message indicates that the login is successful. [root @ Test2 Test] # [root @ Test2 Test] # otPort cvsroot =: PServer: bogus@192.168.10.11: 2401 / var / cvsroot [root @ Test2 Test] # cvs login logging in to: pserver: bogus@192.168. 10.11: 2401 / VAR / CVSROTCVS Password: # Note: Enter the password, there is no error message indicating that the landing is successful. [root @ Test2 Test] # Problem in configuration 1 CVS login logging in to: pserver: cvsroot@192.168.10.11: 2401 / var / cvsrootcvs password: no such user cvsroot in cvsroot / passwd
Solution, view discretion is the / var / cvsroot / cvsroot / passwd file is not included in the CVSRoot user
2, only cvsroot users can log in, other users can not log in to see the reason is found to be the server_args = -f - allowing-root = / cvsroot pserver directory parameter because we configure this configuration The CVS work directory is / var / cvsroot, not / home / cvsroot, so the parameter is server_args = -f - allow-root = / var / cvsroot pserver, all users can log in