Setting Up CVS and SSH

Scott McPeak   George Necula


This document is intended to get you started with the tools that are necessary for checking out stuff out of the manju CVS repository. These instructions work on Linux and Windows (NT4.0, 2000, XP and also less reliably on 95/98/Me).

1  If you want to use Windows

1.1  Get cygwin

You must have a bunch of Unix tools installed on your machine. (In the future we might be able to avoid these but for now you are better off with them.). Here is what I (George) do to install Cygwin. You need a good network connection for this. If you get a compilation error in file “cltkImg.c” while you compile Ocaml v 3.06, then you should patch the Ocaml sources as explained at http://groups.google.com/groups?selm=fa.i2v96ov.1p7cmbc%40ifi.uio.no (It is easy).

1.2  Customize ssh

Set the environment variable HOME to point to your home directory. I use C:\Necula.

For some strange reason ssh does not see this HOME variable and insists on looking at /home/necula instead. So I create a link as follows:
bash
cd /
mkdir home
ln -s /cygdrive/c/Necula /home/necula

2  Configure CVS

2.1  .cvsrc

Create a ~/.cvsrc file with two lines in it:
cvs -q
update -d

2.2  .ssh/config

Create a ~/.ssh/config file with this line in it:
ForwardX11 yes
If the DISPLAY environment variable is set when you invoke ssh (e.g. to localhost:0.0 then ssh will do automatic X11 forwarding for you. This is not useful for the use of ssh with cvs but when you want to do remote login.

2.3  Using CVS with ssh

Note: these instructions appear to work even on Windows with the ssh and cvs that ships with cygwin (provided that you have installed cygwin and ssh as discussed in Section 1.2).

Set the environment variable CVS_RSH to ssh.

Now you can use cvs with ssh but you will have to type the remote password everytime you run cvs.

If you want to be able to use ssh without typing a password everytime here is what you can do. These instructions are for the case when you use one of the newer versions of SSH that support the protocol 2.
  1. If you have a DSA private key that is already authorized on the server, copy it to ~/.ssh/id_dsa and you should be done.
  2. Otherwise
    1. Run ssh-keygen -t dsa to create a private key. Choose a passphrase and remember it. If you do not have a passphrase then anybody who gets access to your machine will also be able to log in to the server. This step should create the files id_dsa.pub and id_dsa in your ~/.ssh directory.
    2. Copy the public key to the server (say manju.cs.berkeley.edu). Make sure you append the key to authorized_keys2, not to authorized_keys.
                   cd ~
                   scp .ssh/id_dsa.pub manju:~/.ssh/newpublicid
                   ssh manju
                   cd .ssh
                   cat newpublicid >> authorized_keys2
                   rm newpublicid
                   
If you want you can even start an agent to do the authentication for you. The steps are different for Linux or Windows:

3  Using CVS

You should read the rest only if you have not used CVS before.

CVS is used to synchronize changes to the project across multiple developers. See the CVS website for detailed information

http://www.cvshome.org/

There are a few common commands you'll need. Each of these is to be run in the base 'cil' directory (the one with 'regrtest'):

4  Useful Links


This document was translated from LATEX by HEVEA.