www.mvcsys.deHOW TO Setup SVN+SSH on Windows®

Written by Marcus von Cube, Dec. 23, 2012

Here is a short walk-through to make SVN on SourceForge work with the secure svn+ssh: protocol needed for update access to the repository.


  1. SVN Client (command line SVN from http://subversion.apache.org/packages.html#windows and/or Tortoise SVN from http://tortoisesvn.net/).

  2. PuTTY, a terminal program providing an SSH client, from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Make sure you get the installer version.

Install the packages. On my German Windows XP installation, PuTTY is in C:\Porgramme\PuTTY. The command line SVN is in C:\APPS\SVN\bin. I've setup the PATH variable on my system to point to both directories. This makes command line access easier.

Tell SVN where to find PuTTY

The SVN client needs to know where PuTTY, to be precise, its SSH client plink.exe is installed. There are two ways to do this.

  1. For the command line client, setup an environment variable:

    The delimiter here is a forward slash '/'! A proper entry for an English Windows version would be C:/Program\ Files/PuTTY/plink.exe. It might as well work without escaping the space character with '\' but I haven't tried it.
  2. In Tortoise SVN open the Settings dialog:
    Tortoise Settings
    The delimiter is a backward slash '\'. 

Create Keys

For SSH to work properly, create a private/public key pair. The tool is PuTTYgen:

PuTTYgen screen 1

You should get a screen like this when you're done:

PuTTYgen screen 2

The passphrase is optional but recommended. You need to save the private key in a secure location. Don't close the PuTTYgen window, yet!

Install Your Public Key in SourceForge

Go to sourceforge.net and log in. Now update your account settings:

SourceForge Account Settings

Go to Services:

SourceForge Services

Click on the Edit SSH Keys for Shell/CVS link:

SourceForge Keys

I've already pasted the data shown on the PuTTYgen dialog as the public key. The data goes to a single line! You can have more than a single key installed here. It takes a few minutes before SourceForge has internally propagated the newly installed key(s) so you'll need to be patient.

Make the Secret Key Available to Applications

The SSH client on your PC needs access to your public key. The PuTTY tool pageant.exe does this for you. Make it start automatically when you start your Windows session by putting a link in your Startup (Autostart) folder:

Pageant.exe in Autostart

Click on the icon to start the program. It will appear in the system tray:

Pageant Menu

Add your secret key from the file where you've saved it:

Pageant Open

Input the passphrase on request.

You'll need a first time connection via SSH to the host svn.code.sf.net to store the host's certificate as trusted in PuTTY's cache:

C:\Programme\PuTTY>plink svn.code.sf.net
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:
ssh-rsa 2048 86:7b:1b:12:85:35:8a:b7:98:b6:d2:97:5e:96:58:1d
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
Store key in cache? (y/n) y
login as: mvcube

The final login will fail but that's ok.

Check Out the Project

Now you should be able to do the initial checkout with the command given by SourceForge. Here is the procedure for the command line:

svn checkout --username=mvcube svn+ssh://mvcube@svn.code.sf.net/p/wp43s/code/ wp43s

The checkout should complete normally. From this on, you shouldn't be asked for a key or passphrase again. SVN should just work.