title: ssh tunneling with visualsvn
body: <p>I have been asked to setup VisualSVN for Visual Studio 2008.</p>
  
  <p>Due to firewall restrictions and server configuration. I need to use <em>ssh tunneling</em>.</p>
  
  <p><strong>My problem is this:</strong> </p>
  
  <p>The local machine needs to connect to a gateway machine via ssh then connect to the Subversion server so</p>
  
  <pre><code>Local machine ---{ssh}--- gateway ---{ssh}-- Subversion server
  </code></pre>
  
  <p>I am not exactly sure of the correct process to do this. </p>
  
  <p>It appears that I must start a ssh process using <em>plink</em> to open a local port and forward that to the remote subversion server.</p>
  
  <p>E.g.: <code>plink user@gateway -L 22:192.168.1.1:22</code></p>
  
  <p>Then when VisualSVN starts it uses <em>Tortoiseplink</em> to make the actual connection through to the Subversion server using <code>svn+ssh://username@localhost:22/myrepo</code></p>
  
  <p>This seems very very clunky. </p>
  
  <p>Firstly it needs several steps to setup the connection.<br>
  Secondly I need <em>plink</em> running which leaves a command prompt on the desktop (clutter = yuck).<br>
  Lastly I need to use two different programs that do the same thing. (<em>plink + tortoiseplink</em>)</p>
  
  <p>The problem is that tortoiseplink doesn't run in the background. As soon as I connect to the ssh gateway and enter the password it closes again. So I can't use it to create the initial connection.</p>
  
  <p>If I use plink instead of tortoiseplink in VisualSVN then I never get prompted for the password. So it just hangs with an open command prompt and no password request.</p>
  
  <p><em>Is there a way to setup VisualSVN so that everything happens in one command line?</em></p>
  
  <p>I have searched high and low for a suitable and clean method to tunnel from VisualSVN to the remote server and have found very little. It all either assumes one hop (not two like mine) or it glosses over all the hard bits.</p>
  
  <p><em>How does VisualSVN deal with multiple repositories on different servers?</em> It appears you need to use the same ssh commandline for every project which means only one repository. or at least only one host!</p>