How To Get Set Up To Use CVS (To
Check-Out And Check-In) From A Windows Platform
Setting up CVS to work on a Windows platform and to use SSH is not
straightforward. For this reason, we present a complete guide here.
Major sections are separated by horizontal lines.
Why SSH And SCP (Secure Protocols) Are Required For
Accessing SourceForge
SourceForge has a
page explaining this, which is very informative. This page is
recommended reading. (If this page ever disappears, here is a
.PDF
snapshot of this page as of 06/2001.)
Warning: There Are Different Distributions And Implementations Of SSH
And SCP
There are several distributions of SSH and SCP clients. They are not
all compatible with CVS. We do not know the reasons for this, but please
be aware of this. We do not understand the interface between CVS and SSH
(i.e. how CVS uses SSH), or why individual distributions do or do not work.
Here are the distributions that we are aware of:
- SSH Secure Shell For Windows: The
company SSH makes a product called SSH Secure Shell For Windows.
Very generously, it is encouraged that you purchase the product, but for
individual use for non-profit purposes, it can be downloaded for free
(without technical support). This product also includes a secure file
transfer client, with a good graphical interface including the ability to
cut and paste entire directories from Windows Explorer. This product
is full-featured and works wonderfully for transferring files to and from
SourceForge (especially for uploading web pages). Unfortunately, we
have not found a way to use it with CVS.
- Putty:
Putty is a free distribution of SSH and SCP. Putty is very
helpful for interactive use, but we have not found a way for it to be used
with CVS.
- An Unknown Free Distribution: The best distribution we've
found is described at A
Quick And Dirty Guide To Using SSH And CVS With SourceForge In A Win32
Environment (.PDF backup as of
06/01). This distribution is found here.
There are two drawbacks found to this distribution:
- It can't change AUTOEXEC.BAT on Windows NT and Windows 2000.
This means that the file must be changed manually or one must setup
environment variables a different way.
- The ssh-keygen program with this distribution does not
work. One might want to use ssh-keygen to generate a
public/private keypair so that one can use CVS without needing to enter
a password--this is described here
(.PDF backup as of 06/01).
We discuss how to work around these limitations in a little bit more detail
elsewhere in this document.
Obtaining And Setting Up The Recommended Distributions Of SSH
And CVS For Use With SourceForge
This section describes the steps to set up SSH and CVS on a Windows platform
for use with SourceForge. We do not claim that this is the only way
to do this. We use only the command-line interface (products like WinCVS
are not discussed). Also, because hard drives are so large now, most users
can place all CVS'd materials on their C: drive. For this reason, only the
C: drive is discussed.
- These instructions come primarily from A
Quick And Dirty Guide To Using SSH And CVS With SourceForge In A Win32
Environment (.PDF backup as of
06/01). This is recommended reading to start with.
- Obtain the command line version of CVS for Windows. This can be
obtained at the official CVS site (and
you are searching for the command-line client for Windows). If this
site is down or you are not sure what to get or you want to be sure you are
using what we are using, the .ZIP file is mirrored here.
(We use CVS 1.11, which seems to work perfectly.)
- Unzip the file and place CVS.EXE in the right place for your system.
This would generally be the place where other command-line utilities from
Microsoft are stored (PING.EXE, TELNET.EXE, XCOPY.EXE, etc.). A good
strategy is to search for these common command-line utilities and put
CVS.EXE in the same place. On a Windows 2000 machine, the correct
directory is:
C:\WINNT\SYSTEM32
but on other versions of Windows this directory containing common
command-line utilities might be a different one.
- Obtain the recommended distribution of SSH here.
If this site is down, here is a mirror of the
distribution. Because of the potential difficulties in NT systems (the
AUTOEXEC.BAT file can't be changed), it isn't recommended that you do the
installation. Instead, unzip the distribution, then unzip the .ZIP
file contained in it, then copy the following files to the same directory
that was identified as the right place for CVS.EXE, above:
- SSH.EXE
- SCP.EXE
- SSH-KEYGEN.EXE
- GMP.DLL
- ZLIB.DLL
- Create a home directory for yourself:
mkdir c:\home
- Create an etc directory for yourself.
mkdir c:\etc
- In your \home directory, create a batch file which sets up environment
variables for using SSH and CVS. A good name for this batch file might
be ENVSET.BAT or CVSSET.BAT. This file might also be placed in the
same directory as CVS.EXE. We will assume (for this example), that
this batch file is named ENVSET.BAT and resides in c:\home.
The batch file should look like this:
set CVSROOT=:ext:username@cvs.projectname.sourceforge.net:/cvsroot/projectname
set USERNAME=username
set HOMEDRIVE=c:
set HOME=\home
set HOMEPATH=\home
set CVS_RSH=ssh
where username and projectname should be substituted as
described above.
- Open a DOS shell. Run the batch file which was created above.
Note that this batch file must be run after a DOS shell is opened but before
SSH or CVS are used (i.e. every time you prepare to use CVS from a DOS
box). Another alternative is to place the same commands as are in this
batch file in AUTOEXEC.BAT. Leave this DOS box open.
- Open a connection to the Internet. For example, log on to AOL or
dial up some other way.
- Test your ssh connection to SourceForge.
To do this, in the DOS type:
ssh -l username projectname.sourceforge.net
where username is your SourceForge login ID and projectname
is the name assigned to your project. At this point you should be
prompted for your password (the same password you use to log into SourceForge).
After you enter your password, you should then receive the traditional Linux
login messages and prompt. If you cannot log in, it is pointless to try
to use CVS because that cannot work either. This test must pass.
You must be able to login using this method before you can go further in these
instructions.
If you were able to log in, use CTRL-D to logout, but leave the DOS box
open.
- At this point in the instructions you will be able to use CVS
successfully. In the DOS box, change directories as appropriate and
issue standard CVS commands. You will be prompted for a
password. Remember that each time you open a DOS box you must use
ENVSET.BAT to set the environment variables or CVS will not work.
- At this point in the instructions, CVS is functional. The remaining
instructions are to eliminate the burden of password entry. Strictly
speaking, this is not necessary, but it is a great convenience.
- Create an SSH keypair. Unfortunately, the ssh-keygen
program above does not seem to work correctly for Windows (can anybody get
it to work?). The best alternative is to log in to the SourceForge
servers using SSH.EXE as described in the test above, then run ssh-keygen
there. When you do this, the public and private keys (identity.pub
and identity) will then be placed in the .ssh folder of your
home directory. When you generate the keypair, choose no passphrase
(just hit the RETURN key at any prompt for a passphrase or password).
(You do not want to generate a passphrase because this would need to be
entered each time you use CVS, which is surely not what you desire.)
- Copy the two files identity and identity.pub from ~/.ssh
on the SourceForge server to \home\.ssh on
your Windows machine. This was done using the SSH Secure Shell For Windows secure
file transfer program. We have not attempted doing this without using
file transfer software, and are not sure how to do it, since the identity
file is binary. (We welcome suggestions here.)
- Delete the file identity from the SourceForge server. One
does not want the private key hanging around. However, the public key identity.pub
should stay there.
- Find the Account Preferences for your user ID in the set of
SourceForge web pages, find the SSH/CVS keys near the bottom of the page,
and paste the contents of identity.pub into the space in the web page.
- Within 24 hours, CVS should stop nagging you for passwords when you use
it.
This
site is maintained by Dave Ashley (dtashley@aol.com).