Menu

Getting ssh/CVS running in Windows

Developers
Ed Leafe
2002-04-24
2004-02-24
  • Ed Leafe

    Ed Leafe - 2002-04-24

    First, install Cygwin. This provides the secure communication functions that Windows lacks. Go to http://www.cygwin.com, and click the "Install Cygwin Now" button. When prompted to save or run the program, choose to run it from its current location. That will begin the installation process. Follow the prompts; install in C:\cygwin.

    Add an environmental variable in the System control panel named 'HOME'. Set it to 'C:\cygwin\home\username', where 'username' is your SourceForge user name. You should have that directory already; if not, create it. Also, add 'C:\cygwin\bin;' to your System's PATH variable. This way Windows can find the necessary executables.

    Once that's done, you don't need to 'use' Cygwin anymore; it provides the necessary secure communication automatically. But let's check to make sure that you can connect. Open up a Command Prompt window, and type:

    ssh username@codebook.sourceforge.net

    where 'username' is your sourceforge user name. You may be prompted to add this server to your list of Hosts; if so, answer yes. You should be prompted for your password. Enter it, and you should see the SourceForge login banner, as well as a Unix shell prompt. If you succeed, great! If not, you probably did not enter your username and password correctly. Once you are in, there's nothing much to do now, so type Ctrl-D to exit.

    Now from the Command Prompt, type the following, substituting your username, of course:

    CD \cygwin\home\username
    ssh-keygen -t rsa -C username@users.sourceforge.net

    When prompted for the filename to save the key, enter: .ssh/id_rsa

    When asked for a passphrase, press 'Enter' both times to indicate that you don't want a passphrase for your key.

    Now verify that you have two new files. Type:

    DIR .ssh

    You should see two files: 'id_rsa' and 'id_rsa.pub'. These are your private and public keys, respectively. They are used to authenticate you on secure connections. We need to copy the public key to the SourceForge server so that it can identify you. We will use 'scp', the 'secure copy' protocol. Type the following:

    scp .ssh/id_rsa.pub username@codebook.sourceforge.net:~/

    Enter your password when prompted. You should see a notice that your file was copied. Now we need to get that into the server's list of public key. For this, we need to ssh into the server again. So type:

    ssh username@codebook.sourceforge.net

    and enter your password when prompted. When you are at the Unix shell prompt, type:

    cat id_rsa.pub >> .ssh/authorized_keys
    cat id_rsa.pub >> .ssh/authorized_keys2
    rm -f id_rsa.pub

    The first two commands append your public key to the list of authorized keys on the server. The last command deletes your public key file. Now you can press Ctrl-D to exit ssh. To test if the keys are correctly configured, try connecting to the server again using ssh. If everything went well, you should no longer be prompted to enter your password; instead, you should be immediately taken to the Unix shell prompt. You've now set up secure communications to the Codebook server on SourceForge!

    If you get this far, try to get WinCVS up and running. You want to set the prefs up as follows:

    Authentication: ssh
    Path: /cvsroot/codebook
    Host Address: cvs.codebook.sourceforge.net
    User name: [your sourceforge username]

    Remember to click the "Settings..." button next to the Authentication field. In that dialog, check the "RSA public identity file" box, and enter the path to your private key. This should be close to c:\cygwin\home\username\.ssh\id_rsa if you used the standard directory choices. Close the dialog, save your prefs, and you should be ready to go!
    -- Ed

     
    • Bhavbhuti Nathwani

      Hi Ed.

      Sorry to have tried your suggesstions late but my HDD required formating. 

      I have installed Cygwin from my local directory after downloading.

      the ssh command does not exist on the hdd.  I cygwin/bin supposed to have it?  The path is set up correct but bin does not have ssh.exe

       
      • Ed Leafe

        Ed Leafe - 2002-05-02

        I think you better try re-installing Cygwin. Without the ssh.exe file in \cygwin\bin, you won't be able to do much.
        -- Ed

         
        • Bhavbhuti Nathwani

          I have uninstalled cygwin and now I am trying to reinstall from the internet.

          One thing I noticed is that when I was asked to setup, prev., curr. or exp. versions, I lookedup the details of curr and a lot of items were skipped.  But more so under the listing in "S", there is sh-utils, sharutils, etc. but no ssh.

          Have I picked the wrong mirror site?

           
    • Pablo Rivera

      Pablo Rivera - 2002-05-04

      Hellow everyone! I just wanted to add my experience with this setup process. (I've installed Cygwin several times and the SSH executable is nowhere to be found.)

      Second, (under XP) what tool or object in the system control panel do I use to set "HOME" variable and its corresponding value.

       
    • Pablo Rivera

      Pablo Rivera - 2002-05-04

      Well, I'm back. Found out how to set the "HOME" variable and did it. Also modified the "PATH" variable to point to the bin folder.

      But I still do not find SSH.EXE, nor SSH-KeyGen. When, where or what creates these files? :(

       
    • Pablo Rivera

      Pablo Rivera - 2002-05-05

      Using the Windows interface to cygwin I was able to log on to codebook.sourceforge.net. After the login, I was able, from inside the the post login prompt, to issue the ssh command. In this way the SSH application appears to reside in the host computers, not in mine. Next problem. I tried to append the public key to the list of authorzed ... using the "cat" command, but the system responded that there was no such file. Interesting stuff <g>

       
      • Bhavbhuti Nathwani

        Do we have a cygwin alternative?

         
    • Enrique Ramírez

      Ufff, at end I do it, i could entry with wincvs, now I must learn it.

      thanks!

      From Gaviln!

       
      • Bhavbhuti Nathwani

        I finally got cygwin to install from the internet and have set up the environment variables.

        Could you let me know how I can login onto sourceforge.  I have wincvs and have used it previously for codebook.

        Any help will be appreciated

        Thanks

        Regards
        Bhavbhuti

         
    • Bhavbhuti Nathwani

      I tried

      login
      venussoftop@sourceforge.net

      and gave my password, got a login incorrect

      Please advise

       
      • Enrique Ramírez

        Hi, if you like I has a messenger

        programa1@hotmail.com

        and try it in chat.

        From Gaviln!

         
        • Bhavbhuti Nathwani

          Thanks.  But right now I am busy setteling the machine into quite.

          Any step by step to get cygwin to work without ssh?

           
    • Bhavbhuti Nathwani

      Hi Ed,

      Me again.  There is a new doc on the Sourceforge @ http://sourceforge.net/docman/display_doc.php?docid=766&group_id=1 but uses PuTTY and I got both the apps up and PuTTY running.

      PuTTY returns all okay and CVS is running but gives the following error:

      Python is not available !
      CVSROOT: venussoftop@cvs.sourceforge.net:/cvsroot/codebook (ssh authentication)
      TCL is available, shell is enabled : help (select and press enter)
      TCL or Python are *not* available, shell is disabled
      Python is not available !
      Logging in is only required with pserver authentication (see Preferences dialog).
      Please consult the CVS manual for more details.
      Python is not available !
      NEW CVSROOT: venussoftop@cvs.sourceforge.net:/cvsroot/codebook (ssh authentication)
      Python is not available !
      NEW CVSROOT: venussoftop@cvs.codebook.sourceforge.net:/cvsroot/codebook (ssh authentication)
      Python is not available !
      NEW CVSROOT: venussoftop@cvs.codebook.sourceforge.net:/cvsroot/codebook (ssh authentication)
      Python is not available !
      Python is not available !
      cvs checkout -P /cvsroot/codebook (in directory C:\vso3\CVSWork\CodeBook)
      The server's host key is not cached in the registry. You
      have no guarantee that the server is the computer you
      think it is.
      The server's key fingerprint is:
      1024 ff:f1:42:ca:ac:ae:a7:c8:e8:52:45:65:a1:a0:0a:b6
      If you trust this host, enter "y" to add the key to
      PuTTY's cache and carry on connecting.
      If you want to carry on connecting just once, without
      adding the key to the cache, enter "n".
      If you do not trust this host, press Return to abandon the
      connection.
      Store key in cache? (y/n) cvs checkout: warning: unrecognized response `venussoftop@cvs.codebook.sourceforge.net's password:
      ' from cvs server
      cvs checkout: warning: unrecognized response `venussoftop@cvs.codebook.sourceforge.net's password:
      ' from cvs server
      cvs checkout: warning: unrecognized response `venussoftop@cvs.codebook.sourceforge.net's password:
      ....
      ....

       
    • Dave Eccleston

      Dave Eccleston - 2004-02-24

      Launch the cygwin setup utility.
      Answer the various screens until you get to the "Select Packages" section.
      In the category "Net" is the package "openssh".  By default it is skipped.  Make sure you click it till is says a version number.

       

Log in to post a comment.