Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2028409
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: LINUX

2006-04-28 12:46:05

               建立CVS服务器

1.  建立cvs用户组

#groupadd cvs

2.  建立cvsroot用户

#useradd -g cvs -G cvs -d /home/cvsroot cvsroot

3.  设置cvsroot用户密码

#passwd cvsroot

4.  开始创建单个项目

#mkdir /home/cvsroot/share

5. 开始建立仓库
#cvs -d /home/cvsroot/share init

7.  建立cvs的用户文件

#touch /home/cvsroot/share/CVSROOT/passwd

8.   创建密码生成工具
#vi
/home/cvsroot/share/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, $salt);
print "${crypttext}
";

#chmod 777 /home/cvsroot/share/CVSROOT/passwd.pl

生成 密码为 "tmp" 的密文可以这样
/home/cvsroot/share/CVSROOT/passwd.pl "tmp"

9.  创建可以登陆cvs服务器的用户名

#vi /home/cvsroot/share/CVSROOT/passwd
添加两个用户trotter,mimi,其中****为密码,由上面的passwd.pl生成,比如,要将trotter的密码设置为trotter,
可以这样:
/home/cvsroot/share/CVSROOT/passwd.pl "trotter",
然后用产生的结果替换掉下面的*****即可

trotter:*****:cvsroot
mimi:*****:cvsroot


10.  配置cvspserver服务。建立/etc/xinetd.d/cvspserver文件,内容如下:

service cvspserver
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root=/opt/cvsroot pserver
log_on_failure += USERID

}

11.  检查/etc/services文件中是否有如下内容,没有则加上:

cvspserver      2401/tcp                        # CVS client/server operations

cvspserver      2401/udp                        # CVS client/server operations

12.              启动cvs服务

#service xinetd restart

13.              检查cvs服务是否正确启动。

#netstat -l | grep cvspserver

如果输出如下内容则正确启动:

tcp        0      0 *:cvspserver            *:*                     LISTEN

14.              在另一台机器测试cvs

# export CVS_RSH=ssh

# export CVSROOT=:pserver:username@your_ip:/home/cvsroot/share

# cvs login


阅读(1968) | 评论(0) | 转发(0) |
0

上一篇:Make 及 Makefile 相关

下一篇:Linux 常见问题

给主人留下些什么吧!~~