April 21st, 2005
To set up WinCVS to work over SSH:
Get the software
If you've got a 1.x version of WinCVS, uninstall it now and restart your computer.
Download & install the latest stable version of WinCVS from:
www.wincvs.org
At the end of the install, the installer will tell you if it can't find Python. If you don't have python, download & install the latest stable version from:
www.python.org/download
The following instructions assume you already have PuTTY and you already use it for SSH connections to the remote network (which I'll assume is your office).
If you don't have PuTTY, you can download it from:
www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Port forward the CVS port
Set up a new tunnel in PuTTY (i.e. forward a local port to a port on a remote computer).
By default the CVS server listens for connections on port 2401 and this is the port to which WinCVS talks. You therefore have to forward port 2401 on the local machine (127.0.0.1) to port 2401 on the remote CVS server (e.g. cvs.yourcompany.co.uk).
To do this in PuTTY:
- Load the session that you use to connect to the remote network (e.g. you office network).
I'm assuming you already SSH to this network so you have already set up and saved the settings for a login session to this network in PuTTY.
- In the left pane, go to Connection > SSH > Tunnels.
- Enter 2401 in the Source Port field.
- Enter either hostname:2407 or IPaddress:2407 in the Destination field.
- For example: cvs.yourcompany.co.uk:2407
- In the left pane, click Session.
- Click Save.
The next time you use this saved session to login to the remote network, the tunnel will be established, so that anything sent to port 2407 on your local computer will be forwarded through to port 2407 on the CVS server on the remote network.
Setting up WinCVS
If you're upgrading from an old version of WinCVS you will notice that the CVSROOT is no longer specified in the Admin > Preferences dialog box. It's now in the Admin > Login dialog box.
:pserver:[username]@[servername]:/[path]
For example:
:pserver:john@cvs:/yourcompany/repository
WinCVS sends the above login request to the server as the command:
cvs -d :pserver:john@cvs:/yourcompany/repository login
This is what you would enter if you were using CVS from a command line.
If you try to log in now, the login will fail because your computer will not be able to find the host you are trying to connect to. In the above example, the server name is cvs. Your computer needs some way of resolving this host name to an IP address. You do this using the Windows hosts file.
Use a text editor to edit the hosts file. This usually resides in the directory:
[Windows installation directory]\system32\drivers\etc
e.g.
C:\WINDOWS\system32\drivers\etc
At the end of this file add:
127.0.0.1 [server name] # Your comment
For example:
127.0.0.1 cvs # Map this host name to the local host
127.0.0.1 cvs.yourcompany.co.uk # Map this domain to the local host
Save the file.
Now, when you try to access a server named cvs or a domain named cvs.yourcompany.co.uk, your computer knows to use the IP address 127.0.0.1, which is the local computer. The name "cvs", in this example, is identical to "localhost" – both are aliases for the IP address 127.0.0.1.
The result of this is that, while you are logged on to the remote network, local port 2407 is forwarded to the remote CVS server, so connections to port 2407 on cvs (in the example above) are directed to the remote server (which, in our example, also happens to be called cvs). Using the hosts file in this way allows you to use the same server name (e.g. "cvs") as you do when you are working on a machine in your office that is part of your office network domain.
Logging in
Usually you can simply log in to the CVS server using your network username/password. However, the server may be set up to use localhost authentication, using its own password file. The server may also be set up to use both types of authentication, trying to authenticate locally first and then falling back on network authentication.
If the server uses local authentication, you must ask the administrator to add your password to the password file. Usually this is done using an encryption program to generate an encrypted password which you then give to the administrator to put in the password file.
A typical scenario would be to use a mkcvspwd program on a networked server to which you *do* have access to:
- Run the encryption program (using the command mkcvspwd – if that's what it's called and it's in a sensible place like /usr/local/bin, or [path]/[program] if not)
- Type in the new password twice.
- Copy the encrypted version that the program supplies.
- Email this to the administrator and ask him/her to put it in the password file for CVS.
Once you've set up a server-specific password, you obviously must remember it or you won't be able to use CVS. If you forget your password, repeat the above process.
Once you've logged in you can do all the usual CVS stuff, just like you were working on a PC at the remote location: e.g. check out a module, work on a file, update it, commit it.
Read the rest of this entry »
Potentially similar posts