Aurélien Gâteau

Windows, svn+ssh and the Subversion command line client

written on Tuesday, July 3, 2007

This morning, I needed to access an svn+ssh Subversion repository from a Windows box. Since I am a command line aficionado, I decided to do it using the Subversion command line client. It turned out to be quite more complicated than I thought... So here is how I did it :

Download plink.exe and puttygen.exe from Putty website.

Next step is to generate an SSH key and place it on your server.

  • Start puttygen and generate a private key.
  • Save it.
  • In the upper part of the window, there is a text field labeled "Public key for pasting into OpenSSH authorized_keys file:". Log on your server and append the content of this text field to the $HOME/.ssh/authorized_keys file (create it if it does not exist). The content of this text field is different from what you would get with the "Save public key" button. Do not try to copy this generated public key. It won't work.
  • Check if it works: try to login on the server with plink:

plink -i c:pathtoyourkey.ppk user@server

If everything goes well, you should get logged in without getting asked for your password. Now you need to configure Subversion to use plink for "svn+ssh" uri.

  • Edit the file c:\Documents and Settings\user\Application Data\Subversion\config
  • Locate the section named [tunnels]
  • Add the following line :

ssh=c:/path/to/plink.exe -i c:/path/to/your/key.ppk

You are done, it should work now. Let's give a try:

svn co svn+ssh://user@server/path/to/svn/repository

This post was tagged ssh, svn, tips and windows