1.验证cvs安装
#rpm -q cvs
2.创建cvs用户组和用户
#groupadd cvs
#adduser cvsroot
#passwd cvsroot
3.创建CVSROOT
#mkdir /home/cvsroot
#chown cvsroot.cvs /home/cvsroot
4.初始化CVS
#su - cvsroot
#cvs -d /home/cvsroot init
5.添加环境变量
#vi /etc/profile
在尾部添加两句:
CVSROOT=/home/cvsroot
export CVSROOT
#/etc/profile
6.启动cvs服务器
#vi /etc/xinetd.d/cvspserver
service cvspserver
{
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvsroot pserver
log_on_failure += USERID
only_from = 192.168.0.0/24
}
#chmod 664 cvspserver
#/etc/rc.d/init.d/xinetd restart
#netstat -lnp | grep 2401
#netstat -l | grep cvspserver
7.创建3文件
#vi /home/cvsroot/CVSROOT/passwd
test:test_passwd:cvsroot
#touch /home/cvsroot/CVSROOT/readers
#vi /home/cvsroot/CVSROOT/writers
test
8.pl
#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";
#chmod 111 passwdgen.pl
#./passwdgen.pl "test_passwd"