Using SmartSVN with a tunnelled SSH connection

Sometimes SVN servers are not directly accessible from the Internet, but hidden behind a corporate firewall. Using SSH tunnels is a way to allow access to such servers.

For such environments, the built-in SSH client of SmartSVN can’t be used as it requires direct access to the repository server. However, you can configure and use your system SSH to connect to such repositories.

The easiest way will be to use SSH’s ProxyCommand which can be configured in your .ssh/config file (details).

For my environment, I’m accessing our internal smartserver over the gateway gateway. So my configuration looks like:

Host gateway
 IdentityFile ~/gateway.ssh.key

Host smartserver
 ProxyCommand ssh gateway nc -w 1 smartserver 22
 IdentityFile ~/smartserver.ssh.key

I have stripped off the passwords from both private key files, so authentication requires no interaction (refer here for details). That’s an important step to avoid the OpenSSH password prompt or — even worse — get stuck, if that GUI-prompt does not work. Now I’m able to connect to smartserver via the gateway, simply by invoking:

ssh smartserver

In SmartSVN’s Repository Profiles I have set up following tunnel:

  • Name: ssh-gateway
  • Command: ssh
  • Parameters: ${host} ${svnserve}

In the Add Repository Profile wizard, I have entered URL svn+ssh://smartserver/repos/smartsvn and on the Details page, selected Tunnel set to ssh-gateway. That’s it!

SmartGit 1.5 beta 1

For SmartGit, our graphical Git client, the first beta build for the upcoming version 1.5 is available for download. The most important new features and improvements are (change log):

  • sync command to perform push and pull with one click
  • basic git-svn integration
  • ability to stage individual lines
  • quick stash
  • OS X: changes in the project structure are detected automatically
  • significantly improved submodule support
  • built-in file compare, conflict solver, text editor now support non-fixed fonts allowing to handle far-east-characters

You are welcome to give it a try!

Download the preview build