Here's the steps I went through. Comments follow the # character. Note that this works for me, but there are a number of steps where you might have to change things a little bit for your server (if, for example, you're running on some version of OpenBSD other than 3.1, which is what I tried it on).
Also note that most of this needs to be done as root. You could sudo some of the commands, but I haven't noted which ones need root permissions, so you'll have to figure that out on your own.
Finally, things marked with a * are only needed if you're going to be running pserver (which isn't all that secure, since passwords go across the wire in the clear).
First set up a place for the repository to live
- cd /home # or where ever you want the repositories
- mkdir cvs # this, plus repository name will be the root
Now set up users and groups
- vi /etc/group # add group cvs
- vi /etc/services # make sure cvspserver is in there - it should be
- vi /etc/shells # add /usr/bin/false for accounts with no login privs
- adduser # anoncvs - anonymous user *
- vipw # change shell to /usr/bin/false, change homedir to /home/cvs *
- cd /home# where user directories are created *
- rm -r anoncvs# delete home dirs for users who can't login *
Build the repository and setup users
- cd /home/cvs
- cvs -d /home/cvs/repositoryname init
- cd repositoryname
- chgrp -R cvs .
- chmod ug+rwx . CVSROOT
- cd CVSROOT *
- echo "username:encrypted_cvs_password:username" > passwd *
- echo "anonymous:encrypted_cvs_password2:anoncvs" >> passwd *
- echo "username" > writers # only this user can write *
Enable pserver
- echo "cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/home/cvs/repositoryname pserver" >> /etc/inetd.conf *
- kill -HUP `cat /var/run/inetd.pid` *
Everything should be good to go.