Installation of the CVS server: 1. Check if cvs are installed on your operating system: #> rpm -qa | GREP CVS
If you don't have you can find on the 2nd of Redhat, you can also download it to the latest RPM package online. It is easy to find, in fact, there is no Linux version.
2. Create a CVS user group:
#> GroupAdd CVS
3. Establish a CVSRoot user and the directory of the CVS group:
#> UserAdd -g cvs -g cvs -d / cvsroot cvsroot
4. Add a password for the cvsroot user:
#> Passwd cvsroot
5. Change / cvsroot / directory properties:
#> CHMOD -R 770 / CVSROOT
6. Change the user to log in:
#> su cvsroot
7. Started to create a single item:
#> cd / cvsroot #> MKDir Project1 #> MKDir Project2 8. Start establishing a warehouse:
#> cvs -d / cvsroot / project1 init #> cvs -d / cvsroot / project2 init #> chmod -r 770 ./project1/ ./project2/
9. Establish a CVS service launch file, we use xinetd mode:
#> [Crtl] [d] Switch to 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 - alallow-root = / home2 / cvsroot / project2 pserver log_on_failure = userid}
Note: Due to the length limit of Xinetd's Server_args, you can do this when you want to run a lot of single warehouse:
#> VI CVSPSERVER
Service cvspserver {disable = no flags = reuse socket_type = stream wait = no user = root server = / cvsroot/cvs.run log_on_failure = userid}
Write cvs.run scripts
#> 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 CVS service:
#> /etc/init.d/xinetd Restart
12. Check if the CVSPSERVER service is started:
#> netstat -l | grep CVSPServer should have the following results:
TCP 0 0 *: CVSPSERVER *: * LISTEN II. CVS service user management:
Above we have established two CVS warehouses in Project1 and Project2. Here we have two warehouses to establish CVS users.
13. Create a username and password that can log in to the CVS server:
#> su cvsroot #> vi / cvsroot / project1 / cvsroot / passwd
Trotter: *****: cvsroot mimi: *****: cvsroot
#> vi / cvsroot / project2 / cvsroot / passwd
Trotter: *****: CVSROOT GARY: *****: CVSROOT
The two files are Trotter, MIMI, GARY three CVS users, MIMI has the use of Project1, Gary has the use of Project2, Trotter has the use of Project1 and Project2. The permissions after login are cvsroot privileges. Note: CVS users and system users are different.
14. ***** is a password, generated by the following file:
#> 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% C", Eval $ Randletter, Eval $ randletter; My $ plaintext = shift; my $ crypttext = crypt ($ plaintext, $ sal); print "$ {crypttext}";
#> chmod a x /cvsroot/passwd.pl
15. If you want to generate a password is "123456", then:
#> / cvsroot/passwd.pl "123456"
Encryption password can be obtained, replace ***** in the Passwd file
16. OK, CVS is now fully installed, if you want a user to have Project1 permissions, you join a user in / cvsroot / project1 / cvsroot / passwd; if you want a user to have Project1 and Project2 Permissions, you will give him the same username and password in the / cvsroot / project1 / cvsroot / passwd and / cvsroot / project2 / cvsroot / passwd. Finally, let's try:
#> cvs -d: pserver: Trotter@192.168.1.200: / cvsroot / project1 login
After the command is hit, please enter the password of Trotter, you can enter the password you set. If there is no error message, it is successful (my machine IP address is 192.168.1.200) ***, thank you for your reference Article of all author ***