Working with the new SourceForge svn+ssh protocol in Windows

1 minute read

I’ve been using TortoiseSVN and AnkhSVN for quite some time with SourceForge. Both have been working flawlessly. However, SF recently updated their SVN system to use SVN over SSH (svn+ssh) for read/write access. For TortoiseSVN, this meant entering the password on every commit. AnkhSVN simply stopped working (something about not being able to open a tunnel to the repository). The recommended, secure fix for these problems appeared to be SSH keys. However, setting up my keys did not yield consistent results. TortoiseSVN worked, but most of the time it still asked for my password, which was annoying. AnkhSVN still didn’t work (it started plink which appeared to be stuck). I also didn’t like having Pageant running in the background all the time. Luckily, I’ve found another way. It may not be as secure, since you’re storing your password in plain text, but it’s good enough for me:

  1. Download plink.exe from https://the.earth.li/~sgtatham/putty/latest/x86/plink.exe
  2. Place the plink.exe in your windows installation directory (%windir%)
  3. Open the following file using Notepad %APPDATA%\Subversion\config
  4. Add or Replace the following line in the [tunnels] section (replace login and pwd with your sourceforge login and password) ssh = c:windowsplink.exe -batch -l <LOGIN> -pw <PWD> (note the double backslash)
  5. Save and close the file

Note that in step 4 I wasn’t able to use environment variables, even though the comments suggested it was possible. YMMV.

UPDATE

I’ve found a better way to do this, without storing your password in plaintext.

  1. Download  TortoiseSVN and either install it or extract its binaries to a folder using a tool such as UniExtract.
  2. Locate TortoisePlink.exe among TortoiseSVN’s binaries and set an environment variable named SVN_SSH to its path, using double backslashes (for example C:\Utilities\TortoiseSVN\bin\TortoisePlink.exe).
  3. Open SVN’s configuration file with your favorite text editor: %APPDATA%\Subversion\config
  4. If you already modified your [tunnels] section as described above, revert it to: ssh = $SVN_SSH ssh
  5. Save and close the file

Note that I only tested this with the command-line client, so for AnkhSVN you may need to replace $SVN_SSH with the actual path of TortoisePlink.exe in the SVN config file (again with double backslashes). In that case, you can skip the creation of the environment variable altogether.

Leave a Comment