第 7 章 cvs - Concurrent Versions System

简介:

目录

7.1. installation
7.1.1. chroot
7.2. cvs login | logout
7.3. cvs import
7.4. cvs checkout
7.5. cvs update
7.6. cvs add
7.7. cvs status
7.8. cvs commit
7.9. cvs remove
7.10. cvs log
7.11. cvs annotate
7.12. cvs diff
7.13. rename file
7.14. revision
7.15. cvs export
7.16. cvs release
7.17. branch
7.17.1. milestone
7.17.2. patch branch
7.18. keywords

7.1. installation

过程 7.1. install cvs

  1. install

    $ sudo apt-get install xinetd
    $ sudo apt-get install cvs
    			

    show the cvs version

    $ cvs -v
    
    Concurrent Versions System (CVS) 1.12.13 (client/server)
    			
  2. create cvs group and cvsroot user

    $ sudo groupadd cvs
    $ sudo adduser cvsroot --ingroup cvs
    			

    change user become cvsroot

    $ su - cvsroot
    			
  3. initialization 'CVSROOT'

    $ cvs -d /home/cvsroot init
    			

    if you have successed, you can see CVSROOT directory in the '/home/cvsroot'

    $ ls /home/cvsroot/
    CVSROOT
    			
  4. authentication

    default SystemAuth=yes, you can use system user to login cvs.

    but usually, we don't used system user because it isn't security.

    SystemAuth = no

    edit '/home/cvsroot/CVSROOT/config' make sure SystemAuth = no

    $ vim /home/cvsroot/CVSROOT/config
    SystemAuth = no
    			

    create passwd file

    the format is user:password:cvsroot

    you need to using htpasswd command, if you don't have, please install it as the following

    $ sudo apt-get install apache2-utils
    			

    or

    $ perl -e 'print("userPassword: ".crypt("secret","salt")."\n");'
    			

    or

    $ cat passwd
    #!/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, $salt);
    print "${crypttext}\n";
    
    $ ./passwd "mypasswd"
    atfodI2Y/dcdc
    			

    let's using htpasswd to create a passwd

    $ htpasswd -n neo
    New password:
    Re-type new password:
    neo:yA50LI1BkXysY
    			

    copy 'neo:yA50LI1BkXysY' and add ':cvsroot' to the end

    $ vim /home/cvsroot/CVSROOT/passwd
    neo:yA50LI1BkXysY:cvsroot
    nchen:GXaAkSKaQ/Hpk:cvsroot
    			
  5. Go into directory '/etc/xinetd.d/', and then create a cvspserver file as the following.

    $ sudo vim /etc/xinetd.d/cvspserver
    
    service cvspserver
    {
       disable = no
       flags = REUSE
       socket_type = stream
       wait = no
       user = cvsroot
       server = /usr/bin/cvs
       server_args = -f --allow-root=/home/cvsroot pserver
       log_on_failure += USERID
    }
    			
  6. check cvspserver in the '/etc/services'

    $ grep cvspserver /etc/services
    cvspserver      2401/tcp                        # CVS client/server operations
    cvspserver      2401/udp
    			
  7. restart xinetd

    $ /etc/init.d/xinetd
    Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}
    			
  8. port

    $ nmap localhost -p cvspserver
    
    Starting Nmap 4.53 ( http://insecure.org ) at 2008-11-14 16:21 HKT
    Interesting ports on localhost (127.0.0.1):
    PORT     STATE SERVICE
    2401/tcp open  cvspserver
    
    Nmap done: 1 IP address (1 host up) scanned in 0.080 seconds
    			
  9. firewall

    $ sudo ufw allow cvspserver
    			

environment variable

CVSROOT=:pserver:username@ip:/home/cvsroot

vim .bashrc

export CVS_RSH=ssh
export CVSROOT=:pserver:neo@localhost:/home/cvsroot
	

test

$ cvs login
Logging in to :pserver:neo@localhost:2401/home/cvsroot
CVS password:
neo@netkiller:/tmp/test$ cvs co test
cvs checkout: Updating test
U test/.project
U test/NewFile.xml
U test/newfile.php
neo@netkiller:/tmp/test$
	

7.1.1. chroot

$ sudo apt-get install cvsd
		

environment variable

neo@netkiller:~/workspace/cvs$ export CVSROOT=:pserver:neo@localhost:/home/cvsroot
		

ssh

export CVS_RSH=ssh
export CVSROOT=:ext:$USER@localhost:/home/cvsroot





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
java.lang.Error: Unresolved compilation problem: The type List is not generic; it cannot be parame
java.lang.Error: Unresolved compilation problem: The type List is not generic; it cannot be parame
|
8月前
|
Shell Ruby Perl
don‘t have write permissions for the /System/Library/Frameworks/Ruby.framework
don‘t have write permissions for the /System/Library/Frameworks/Ruby.framework
261 0
java202304java学习笔记第五十一天Your local changes to the following files would be overwritten by merge
java202304java学习笔记第五十一天Your local changes to the following files would be overwritten by merge
77 0
java8的JDK文档--Tutorial - Concurrency Lesson-并发集合(Concurrent Collections)
java8的JDK文档--Tutorial - Concurrency Lesson-并发集合(Concurrent Collections)
java8的JDK文档--Tutorial - Concurrency Lesson-并发集合(Concurrent Collections)
|
Java 程序员
java8的JDK文档--Tutorial - Concurrency Lesson-Thread Pools
java8的JDK文档--Tutorial - Concurrency Lesson-Thread Pools
java8的JDK文档--Tutorial - Concurrency Lesson-Thread Pools
java8的JDK文档------Tutorial - Concurrency Lesson---Executor Interfaces
java8的JDK文档------Tutorial - Concurrency Lesson---Executor Interfaces,对Executor接口的详细描述
java8的JDK文档------Tutorial - Concurrency Lesson---Executor Interfaces
java8的JDK文档--Tutorial - Concurrency Lesson-Concurrent Random Numbers(并发随机数)
java8的JDK文档--Tutorial - Concurrency Lesson-Concurrent Random Numbers(并发随机数)翻译自文档
java8的JDK文档--Tutorial - Concurrency Lesson-Concurrent Random Numbers(并发随机数)
|
安全 Java
java8的JDK文档------Tutorial - Concurrency Lesson---Lock Objects
java8的JDK文档------Tutorial - Concurrency Lesson---Lock Objects
java8的JDK文档------Tutorial - Concurrency Lesson---Lock Objects
|
Java
this version of the Java Runtime only recognizes class file versions up to 52.0
this version of the Java Runtime only recognizes class file versions up to 52.0
270 0
|
XML 开发工具 Android开发
R.java was modified manually Reverting to generated version
R.java was modified manually Reverting to generated version