I want to check out/update the code via proxy since my local connection is slow. I setup ssh tunnel : ssh -D 8090 [email protected]
to forward all the packets to my localhost:8090.
How can I set up subversion to use this?
I want to check out/update the code via proxy since my local connection is slow. I setup ssh tunnel : ssh -D 8090 [email protected]
to forward all the packets to my localhost:8090.
How can I set up subversion to use this?
You are using SSH to set up a local SOCKS server that tunnels to your SSH server. You mention that your reason for doing that is that "local connection is slow" but I fail to see how tunneling to a SSH server will make it faster.
Anyway, your problem is that Subversion can connect through a HTTP proxy or an SSH tunnel, but it has no idea about SOCKS. So you need to SOCKSify Subversion by capturing all its TCP connects and redirecting them to the SOCKS proxy.
Instead of paraphrasing those who have done it before, I'll point you to their detailed explanations :
Or in a nutshell mostly cut'n'pasted from Oliver's page :
Debian contains two socksifiers that are also available on sourceforge. The most recently updated one is ProxyChains, and it's quite straightforward to configure. Most socksifiers work in a similar fashion so these instructions should be a reasonable general case. To configure ProxyChains you just need to edit $(HOME)/.proxychains/proxychains.conf to have only the following lines:
All you then need to do is 'wrap' svn in ProxyChains.
In the above example, the svn application was none the wiser that its TCP connects to the Subversion server were redirected down your SOCKS proxy."
Posting here, as I found a less kludge-y way to do this. You can use Polipo to use your SSH SOCKS tunnel over HTTP proxy, by adding following lines to its configuration:
polipo
by default listen on port8123
. And then in$HOME/.subversion/servers
create a group for subversion hosts you want to check out from, e.g. if your subversion repository host(s) are namedproj1.svn.domain.tld
,proj2.svn.domain.tld
, etc., then add following to[groups]
section:And finally specify a proxy configuration for the group of the hosts you just added by adding a block for the group:
After this you should be able to operate on repository normally, as you used to work without SSH tunnel.
HTH
I don't know about tunnelling with
ssh -D
but using something likeYou can then do tunnelling by adding a new protocol to subversion with the particular port that the tunnel is on. So, in ~/.subversion/config add a line like
in the
[tunnels]
section and then instead of svn+ssh://[email protected] use svn+pssh://user@localhostIf you have an existing working copy you can use
to switch the address the working copy is linked with without having to do a new checkout.
Look at default configuration files at ~/.subversion/ There're many useful examples commented out. Proxies would be set up in ~/.subversion/servers
There are occasions when it's required on Windows PC to get svn+ssh connection to SVN repository through socks proxy server. This problem can be resolved with Putty which provides SSH functionality and can work with different proxy types. Proposed solution does not require local port forwarding.
What's it - SVN will use protocol name to detect that plink.exe should be used for connection and plink will use session name socks_proxy to identify that proxy is present. Remember that PATH_TO_PLINK should be entered with slash, not with backslash. Example for occasion when plink.exe is located in folder C:\Program Files\Putty : ssh=C:/Program Files/Putty/PLINK.EXE -load socks_proxy.
You might give tsocks a try. With tsocks, you configure it to use the SOCKS proxy SSH sets up then run svn like so: