Setting up WinCVS & puTTY

This document explains how to install and set up WinCVS and puTTY, which together allow Windows users to gain simple access to a CVS repository. These instructions were written for NT4, and might need some modification for Windows95/98/ME users.

1. Install WinCVS

This can be found at http://www.cvsgui.org/ - download and unzip it, then double-click on Setup.exe and follow the usual installation wizard procedures. You will need administrator priviledges for this step on NT.

2. Install puTTY

Download the following three files from the download area of http://www.chiark.greenend.org.uk/~sgtatham/putty/:

Create a directory C:\Program Files\puTTY and move the downloaded files into it. You also add both putty.exe and pageant.exe to your Start menu; using the Start->Settings->Task Bar option, select the Start Menu Programs tab, Add button etc. Don't bother to do this for plink.exe which is a command-line only tool that WinCVS will use.

3. Open a puTTY session to the cvs host

Start putty.exe, and change the following entries to create a PuTTY session to the host where your cvs repository resides. Note the category selections are found in the tree on the left side of the dialog box:

Category: Session
Host Name = <name of host that has your cvs repository>
Protocol = SSH
Category: Connection
Auto-login username = <your username on that host>

Return to the category Session, type a session name in the Saved Sessions box and click Save if you will want to re-use this connection. Click Open and you'll eventually get a terminal window to your host. A dialog box will open asking you to confirm that you want to open a session with a host that you haven't used before - click Yes. Type your password and you should be logged in.

4. Generate an ssh1 keypair

At the unix prompt, run the program ssh-keygen (this might be named ssh-keygen1 on systems that also have ssh-2 installed, you need the ssh-1 version for use with puTTY 0.51). This will print various things and then ask you where to save the key. Accept the default filename by pressing return. It then asks you for a passphrase, which will be used to protect the private key. Type a password or short phrase, and repeat it when asked (you will need to remember this pass phrase). The resulting public and private keys are then saved to a subdirectory .ssh in your home directory.

5. Authorize the keypair for ssh logins

The following commands make it possible to use this new keypair to login to your account using ssh without having to give your login password (which is what you want to use WinCVS easily):

cvshost% cp .ssh/identity.pub .ssh/authorized_keys
cvshost% chmod og-a .ssh/authorized_keys

Double-check your spelling of the above authorized_keys filename! If you got a complaint about there being no directory .ssh then look for a .ssh2 directory instead - if that is found then your host has ssh-2 installed, so try using the program ssh-keygen1 in step 4 above instead. The next version of puTTY may support ssh-2 keyfiles; version 0.51 doesn't, but does claim to support the ssh-2 protocol.

6. Copy the keys to your PC

You now need to copy the private key file .ssh/identity (you might also copy the public key file identity.pub) to your PC. Note that the contents of the private key file must be kept secret, so don't put it in a public FTP area or on a web server to do the copy. If you are going to set up more than one PC (say both a home and work machine) you only need to perform steps 4 and 5 once - just re-use the same key file on all machines. I recommend copying the file into C:\Program Files\puTTY as the most convenient location for use later, but you can put it anywhere you like. If several people share the same PC, you might want to name it with your login name rather than just identity.

7. Load the key into Pageant

Start the pageant.exe program. This does not open a window but adds an icon to the Windows status bar. Right-click on this icon and select the Add Key menu item, which brings up a File Open dialog. If you used the recommended location in section 6 above, you should see your private key file in the window which you should select and open. Pageant will then ask for the pass phrase which you used when you created the key, and will then return to the background. You will need to repeat this step and have Pageant running whenever you want to use WinCVS.

8. Configure WinCVS

Start WinCVS, which brings up the preferences dialog the first time it is run. Under the General tab, enter the CVSROOT in the format <user>@<host>:</path/to/repo> where the parts within <> specify your username, hostname and repository path. The authentication selection should be set to SSH server. Under the Ports tab, check the alternate rsh name option and type in the path to the plink.exe program, which is C:\Program Files\puTTY\plink.exe if you followed the recommendations above. You might also want to set some of the other options on the Globals tab such as setting a TCP/IP compression level to reduce the network traffic used (3-5 are common, use a higher level if you have a slow connection and a reasonably fast PC). Accept those settings with OK, then use Create->Checkout Module... to test the connection by checking out a module (you will need to know the module's name or path to do this).

Andrew Johnson, March 2001