`
44424742
  • 浏览: 223751 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

CVS服务器的安装配置

阅读更多

看了不少CVS服务器的安装说明,自己也着手开始进行CVS服务器的安装,现将安装及配置记录如下:

OS环境:RedHat Linux 9

CVS:cvs-1.12.9.tar.gz (下载地址:http://www.cvshome.org)

一、源码包安装

一般来说RedHat Linux 9缺省是安装有cvs的,我们可以通过以下命令查看

[root@VLinux root]# rpm -qa | grep cvs

rpm -e cvs-1.11.2-10

如果出现上面一行的显示则说明已经安装有CVS,我们可以通过以下命令卸载

[root@VLinux root]# rpm -e cvs-1.11.2-10

好了,下面开始正式安装

[root@VLinux src]# tar -zxvf cvs-1.12.9.tar.gz

[root@VLinux src]# cd cvs-1.12.9

[root@VLinux cvs-1.12.9]# ./configure --prefix=/usr/local/cvs --exec-prefix=/usr --disable-server-flow-control

[root@VLinux cvs-1.12.9]# make

[root@VLinux cvs-1.12.9]# make install

二、配置服务

加入cvs服务

[root@VLinux root]#vi /etc/services
cvspserver 2401/tcp #pserver cvs service
cvspserver 2401/udp #pserver cvs service

一般redhat9缺省就有cvs服务,所以不用加

在Linux上CVS服务可以通过inetd、xinetd或tcpwrapper等来启动,其中inetd由于安全理由在许多场合已经被xinetd所取代了。这里我们使用xinetd来启动CVS服务。

  在/etc/xinetd.d目录下为CVS服务创建一个配置文件,比如:/etc/xinetd.d/cvspserver,编辑/etc/xinetd.d/cvspserver,输入如下内容:

  service cvspserver
  {
   disable = no
   socket_type = stream
   wait = no
   user = root
   env = HOME=
   server = /usr/bin/cvs
   server_args = -f --allow-root=/home/cvsroot pserver
  }

  注:

  1)pserver表示是口令认证的访问方式,这是最常用的方式,其他还有gserver,kserver,ext,如果想要更高的安全性可以使用ssh来加密口令和数据流,
不过这里为了用户使用的方便,仍然选的是pserver
  2)--allow-root是指定Repository的目录,可以建立多个Repository

  然后重新启动xinetd:

  [root@VLinux root]# /etc/rc.d/init.d/xinetd restart
  Stopping xinetd: [ OK ]
  Starting xinetd: [ OK ]

  重新启动xinetd服务后,CVS服务也开始工作了。

三、初始化CVS服务器

首先要创建一个名为cvs的组和一个名为cvsroot的用户,以后要访问CVS服务的用户加入cvs这个组:

  [root@VLinux root]# groupadd cvs
  [root@VLinux root]# useradd -g cvs -G cvs -d /home/cvsroot -s /sbin/nologin cvsroot
  [root@VLinux root]# chmod 755 /home/cvsroot

  接下来进行初始化:

  [root@VLinux root]# cvs -d /home/cvsroot init

  这样在/home/cvsroot目录中就产生了CVSROOT目录,其中存放了一些配置文件,如config等,然后设置权限:

  [root@VLinux root]# chown -R cvsroot.cvs /home/cvsroot
  [root@VLinux root]# chmod -R ug+rwx /home/cvsroot
  [root@VLinux root]# chmod 644 /home/cvsroot/CVSROOT/config

下面开始建立CVS用户

建立密码生成文件passwdgen.pl,并设置为可执行

[root@VLinux root]# vi /home/cvsroot/passwdgen.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}\n";

[root@VLinux root]# chmod +x /home/cvsroot/passwdgen.pl

将设要生成的密码为"123456",则使用如下命令

[root@VLinux root]# /home/cvsroot/passwdgen.pl "123456"

MbQ2iaN85u3mM
结果"MbQ2iaN85u3mM"即为所要的密码

接着分别创建配置文件:passwd,writers和readers

[root@VLinux root]# vi /home/cvsroot/CVSROOT/passwd

jasonseaver:MbQ2iaN85u3mM:cvsroot

jack:MbQ2iaN85u3mM:cvsroot

[root@VLinux root]# vi /home/cvsroot/CVSROOT/writers

jasonseaver

[root@VLinux root]# vi /home/cvsroot/CVSROOT/readers

jack

这样就分别建立了可以读写CVS Repository的帐号jasonseaver (密码123456)和只读帐号jack(密码123456)

最后,测试一下

[root@VLinux root]# cvs -d :pserver:jasonseaver@192.168.0.5:/home/cvsroot login

输入密码后,没有收到任何消息,即表示成功



参考文章

CVS服务器快速指南 http://oldsite.linuxaid.com.cn/solution/showsol.jsp?i=394

架设安全的CVS服务器 http://www.yesky.com/SoftChannel/72341285217763328/20040220/1770105_2.shtml

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics