SSH tunneling using Cygwin: The Desktop Unix Emulator

Installation

Before we can tunnel with Cygwin, it must be correctly installed.

The most important consideration for installing Cygwin is creating the appropriate Unix folders. Cygwin's website offers complete and detailed instructions; the below is an abbreviated version.

@ECHO OFF
    SET MAKE_MODE=Unix
    SET CYGWIN=notty
    SET HOME=C:\unix\HOME\[your home directory name]
    SET TERM=VT100
    CHDIR C:\Unix\HOME\[your home directory name]
    SET PATH=C:\Unix\BIN;C:\Unix\USR\LOCAL\BIN;C:\CYGWIN\BIN;%PATH%
    BASH
  

Tunneling

To gain access to CVS via a secure tunnel:

  1. From cygwin, or another UNIX-type command prompt, type: "ssh-keygen.exe -d" and press Enter. You should see:
    • Generating DSA parameter and key.
    • Enter file in which to save the key (/home/Administrator/.ssh/id_dsa): [press Enter key for default location]
    • Enter passphrase (empty for no passphrase): [please leave blank, and press Enter]
    • Enter same passphrase again: [please leave blank, and press Enter]
    • Your identification has been saved in /home/Administrator/.ssh/id_dsa.
    • Your public key has been saved in /home/Administrator/.ssh/id_dsa.pub.
  2. Rename the "id_dsa.pub" from your computer to "username_id_dsa.pub", i.e. "jmorse_id_dsa.pub" and attach it to an issue for technical support. The key will need to be installed on the CVS server for you to gain access through the CVS tunnel. Cunsult with your support representative about a location to upload the *_id_dsa.pub key.

Every time you wish to access the CVS repository you will need to run Cygwin or other UNIX shell and login with:

ssh -x -2 -L 2401:localhost:2401 tunnel@[your_server].com

where [your_server] equals the name of your CVS server.

You should get a message saying "Host key not found, are you sure you want to continue". Type "yes". You need to use the whole word. You get another line and the cursor moves to the left side of the window and just blinks. You can minimize the window, but do not close it.

Note: If you are prompted for a password, your key may not be properly added to the server yet. If that is the case, please contact technical support.

The tunnel will continue running as long as this window is running, except in cases of network error or other connectivity issues. To stop the tunnel, press ctrl-break.