当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 第 4 章 cvs - Concurrent Versions System
帖子发表于 : 2008-11-27 10:30 

注册: 2008-10-09 21:41
帖子: 23
地址: 深圳
送出感谢: 0 次
接收感谢: 0 次
Netkiller Developer 手札
November 15, 2008
Neo Chan



中国广东省深圳市宝安区龙华镇
518109
+86 755 29812080
+86 755 29812080
<openunix@163.com>
文档出处
http://netkiller.8800.org/
http://netkiller.hikz.com/
http://netkiller.mefound.com

版权 © 2008 Netkiller(Neo Chan). All rights reserved.

版权声明

你可以任意转载,转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

文档最近一次更新于 Wed Nov 26 02:58:28 UTC 2008




第 4 章 cvs - Concurrent Versions System

目录

chroot
cvs login | logout
cvs import
cvs checkout
cvs add
cvs status
cvs commit
cvs remove
cvs log
cvs annotate
cvs diff
rename file
revision
cvs export
Branch

milestone
patch branch

cvs release
keywords

过程 4.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$

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


_________________
http://netkiller.8800.org


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 第 4 章 cvs - Concurrent Versions System
帖子发表于 : 2008-11-27 10:33 
头像

注册: 2005-08-14 21:55
帖子: 58428
地址: 长沙
送出感谢: 4
接收感谢: 272
过时的广告?


_________________
● 鸣学


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译