svn over ssh tunnel

 

 

 

 

 

 

 

 

 

It is very often required that you need to commit/update to the svn repository which is only indirectly accessible through a gateway (user can ssh to gateway and gateway can ssh to internal svn server)

Suppose you have a working copy (locally on your machine)  setup with the real svn url (eg : svn+ssh://svn.example.com)

– Make ssh connection with local port forwarding to the gateway server

# sudo ssh gateway.example.com -L 22:svn.example.com:22

Change the repository url to localhost, since the local host connection forward to remote svn server through the gateway.

#cd <local_svn_path>

# svn switch –relocate svn+ssh://svn.example.com/trunk svn+ssh://localhost/trunk

Now you should be able to update, commit, etc to/from your repository.

You can switch it back to the original url when you have direct access to repository.

./arun

 


Posted

in

,

by

Comments

2 responses to “svn over ssh tunnel”

  1. Hector Hurtarte Avatar
    Hector Hurtarte

    What should I change if I’m using http to access my repo?

    1. Arun N S Avatar

      Hi,

      Please establish the tunnel as it is, and try to use your repository with http instead of ssh.
      svn switch -relocate http://svn.example.com/path http://localhost/path

Leave a Reply

Your email address will not be published. Required fields are marked *