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 ha开发者_运维知识库ve 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
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.
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
精彩评论