I have a client that has SVN+SSH set up that I need to access. Unfortunately I can't get my IP white-listed because I'm on Comcast and they have some security policy against that. I do, however, have SSH access to another machine that I can SSH into that can also SSH into the SVN server (via a non-standard port)... So the total loop needs to look like:

Local Computer (OSX)  --SSH-->  Server1  --SVN+SSH_4567-->  SVN Server

I know how to set up basic SSH tunnels, but I'm not sure how to set this up, or if it's even possible. Help? :)

Note that ideally, I can set this up somehow in ~/.ssh/config and ~/.subversion/config and not have to manually tunnel from A->B->C each time I want to make a commit/update

share|improve this question
up vote 3 down vote accepted
ssh -L 1234:svnserver:4567 server1

The tunneled connection will be

ssh -p 1234 localhost

To automate this somewhat you can add the tunnel connection to ~/.subversion/config:

[tunnels]
tssh = ssh -p 1234

and then use svn+tssh://localhost/path/to/repo but I don't know of a way to automate creating the tunnel.

share|improve this answer

Open SSH session to Server1 and setup tunneling in that session:

ssh server1 -L 9000:127.0.0.1:svnserver:22

PS. You might want to check the ssh man page for syntax. I don't remember the correct flags to open a tunnel.

And then locally, you connect to the server using svn+ssh://localhost:9000

share|improve this answer
    
how does that get me to the SVN server? – Mark Kahn Apr 26 '11 at 17:38
    
er, sorry I forgot to type the svnserver part. Answer edited accordingly. – ryanprayogo Apr 26 '11 at 17:44
1  
ssh Server1 -L 1234:127.0.0.1:SVNServer:4567 gives "Bad local forwarding specification" (4567 is the SVNServer's SSH port) – Mark Kahn Apr 26 '11 at 17:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.