Set up the CVS server,
1. check cvs package, or install it
#rpm -qa | grep cvs
cvs-1.11.2-5
2. user, CVSROOT and protocol
in this case, we run cvs under root, CVSROOT is /usr/local/cvsroot, protocol is pserver with default port 2401.
edit the .bash_profile to set CVSROOT=/usr/local/cvsroot and export it.
3. init cvs repository
create the CVSROOT directory,
#cd /usr/local
#mkdir -p cvsroot
run cvs init to create repository
#cvs -d /usr/local/cvsroot init
4. configure xinetd to start cvspserver
create a cvspserver file under /etc/xinetd.d directory
# default: on
# description: the cvs pserver daemon
service cvspserver
{
disable = no
socket_type = stream
wait = no
user = root
group = root
server = /usr/bin/cvs
protocol = tcp
port = 2401
log_on_failure += USERID
log_type = FILE /var/log/cvspserver
server_args = -f --allow-root=/home/orchid/cvsroot pserver
}
restart xinetd
#service xinetd restart
check if cvspserver is started
#netstat -nap | grep 2401
Set up users
1. create the passwd file under $CVSROOT/CVSROOT
#cd $CVSROOT/CVSROOT
#touch passwd
2. create the cvs operation user
#useradd -g users cvsuser
#chown -R cvsuser:users $CVSROOT
3. prepare the passwd perl script
#!/usr/bin/perl
# Usage
# ./cvspasswd.sh
# then copy/paste to the $CVSROOT/CVSROOT/passwd file.
#
$saltchars = 'abcdefghijklmnopgrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./';
while (<>) {
chomp $_;
my ($salt) = substr($saltchars, rand(64), 1).substr($saltchars, rand(64), 1);
my ($c) = crypt($_, $salt);
print "'$_' => '$c'\n";
}
4. add entries to the passwd file
thomas:Encrypted Password:cvsuser
...more entries
Tuesday, July 11, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment