How to connect via ssh to a CVS repository,
TkCVS, and WinCVS

Glenn Murray. Last modified $Date: 2003/10/01 18:46:29 $, $Revision: 1.4 $.

I assume you are connecting via ssh to a UNIX server running GNU CVS which is not using CVS pserver, although I have no reason to believe it will not work if pserver is running.

There are several situations and methods. All of them require some understanding of CVS princples. I recommend the Cederqvist at http://www.cvshome.org/docs/manual/.

The methods are the Simple-Minded Way (see below), or one of several "real" ways which enable automatic cvs access to the remote machine. First we describe how to do this so it works from the command line, and then how to implement GUIs so that you can click your way through CVS.

The Simple-Minded Way

This is a (lame) workaround. Login into the remote machine via ssh (ssh installation is described below---you don't even need ssh, just telnet, but that sort of defeats the purpose of this page). Use the cvs commands there to checkout, update, commit, etc. You can download working copies for editing via ftp, and then upload them for commits, or do all your editing remotely. Life is simple, but not cool.

Command Line CVS

You will need to understand what a "path" is, how to set environment variables, and some basic command line knowledge (e.g., how to "cd").

Confirm that ssh and cvs are on your system, if not, install them. (To see if they are already installed, type 'ssh' or 'cvs' at a command prompt to see if the system has heard of these commands.) Linux users need to install the appropriate package from their distribution. Window users: install Cygwin; see SSH for Beginners for instructions on Cygwin and ssh. Once you have ssh installed you must set up your keys, instructions for this are also at SSH for Beginners.

If your ssh is set up, then set the environment variables CVS_RSH (to ssh) and CVSROOT (as described in the Cederqvist) by putting 'export CVS_RSH=ssh', etc., into your .bashrc file or by typing this line at a command prompt each time you login to your local machine. If you are new to setting environment variables see SSH for Beginners.

You are now ready to enter cvs commands as described in the Cederqvist. This may be all you need.

TkCVS

TkCVS is a nice GUI interface to a remote cvs repository. To use its Module Browser feature, though, some comments must be added to the CVSROOT/modules files. If the cvs administrator won't allow this you may wish to use another GUI, see below. If you yourself are the administrator, no problem.

Before TkCVS will work with ssh you will need to install ssh as described above. If you cannot run cvs from the command line it will not work from TkCVS. The http://www.twobarleycorns.net/tkcvs.html page gives non-Cygwin options for installation as well.

Verify that you have Tcl/Tk installed, if not, download the package (Cygwin or Linux) and install it. If your distribution does not have a tkcvs package, then download TkCVS from http://www.twobarleycorns.net/tkcvs.html. Install it by running doinstall.tcl---note that you need to Enter what you type into the Installation Root window. Read the TkCVS on-line help. Have fun.

WinCVS/gCVS

The CvsGui.org folks have a very polished interface which for some reason is usually much quicker than TkCVS's. See the site http://www.wincvs.org/index.html and especially http://www.wincvs.org/ssh.html for tips on this gui for cvs.

Deprecated: The old way with ssh1, no Cygwin

You really should use the ssh2 methods, but this is retained for historical purposes.

Download cvs.exe from bmrc.berkeley.edu/pub/winnt/util/cvs.exe and put it in your path. At a local command prompt, test it: e.g. run 'C:\Nifty> cvs'. You should get an error message about the correct usage of the cvs command. You should not get an error about the command not being found.

Download and unzip ssh from ftp.cs.hut.fi/pub/ssh/contrib/ssh-1.2.14-win32bin.zip or from here and put the files in a folder in your path.

See also the ssh.exe setups at http://www.wincvs.org/ssh.html.) As Administrator (NT) or in you autoexec.bat (Win9x) set the following environment variables

Test the ssh setup by trying it a command prompt, e.g. C:>ssh -l <login name> <host>---you should get a telnet session. If that works, then you should be able to connect to the server using cvs commands from any local prompt, as in the Cederqvist. You may encounter an error message (stty: tcgetattr: A specified file does not support the ioctl system call.) that I have found be safely ignored with every use. You may also be required to type in your password for each command. To get around this, set up RSA authentication by generating a key pair as follows:

You have now set up RSA authentication (if you want to understand more about this, read up on public key cryptography). Test the setup at a local command prompt, e.g. C:>ssh -l <login name> <host>---you should get a "telnet" session without giving a password. If this doesn't work, review the steps above. Note this won't be a real telnet session---try using Mindterm ssh for that, see below---programs like pine won't work, but these sessions suffice for use by cvs. Exit the session or not.

You are now finally ready to test using cvs. With your knowledge from the Cederqvist, try checking out a cvs module from the remote machine, e.g., C:\Nifty> cvs co <YourModule>, you will have to know the name of the module to check out, of course. If this doesn't work, check the above steps again---that's what I did.


Copyright 2002 by Glenn Murray