Setting up a CVS server on OpenBSD

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

  1. cd /home # or where ever you want the repositories
  2. mkdir cvs # this, plus repository name will be the root

Now set up users and groups

  1. vi /etc/group # add group cvs
  2. vi /etc/services # make sure cvspserver is in there - it should be
  3. vi /etc/shells # add /usr/bin/false for accounts with no login privs
  4. adduser # anoncvs - anonymous user *
  5. vipw # change shell to /usr/bin/false, change homedir to /home/cvs *
  6. cd /home# where user directories are created *
  7. rm -r anoncvs# delete home dirs for users who can't login *

Build the repository and setup users

  1. cd /home/cvs
  2. cvs -d /home/cvs/repositoryname init
  3. cd repositoryname
  4. chgrp -R cvs .
  5. chmod ug+rwx . CVSROOT
  6. cd CVSROOT *
  7. echo "username:encrypted_cvs_password:username" > passwd *
  8. echo "anonymous:encrypted_cvs_password2:anoncvs" >> passwd *
  9. echo "username" > writers # only this user can write *

Enable pserver

  1. echo "cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/home/cvs/repositoryname pserver" >> /etc/inetd.conf *
  2. kill -HUP `cat /var/run/` *

Everything should be good to go.

Copyright 2009, Dave Polaschek. Last updated on Mon, 15 Feb 2010 14:09:26.