通过隧道进行颠覆 [英] Subversion through a tunnel

查看:107
本文介绍了通过隧道进行颠覆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了工作,我在一个封闭的网络中工作.我们已经设置了一些IP地址,这些IP地址只能从我们的网络内部访问.但是,只有一个框,我们可以通过SSH进入并通过隧道进入各自的开发人员框.

For work, I work in a closed network. There are a few IP addresses that we have set up that are only accessible from inside our network. There is one box, though, that we can SSH into and tunnel through to get to our respective developer boxes.

我知道我可以使用ssh的-L参数从我们的开发人员专区获取流量.我想知道是否可以通过我们的Subversion(SVN)存储库来隧道进入打开的盒子,进入封闭的盒子?

I know I can get traffic from our developer box by using the -L argument of ssh. I was wondering if there was a way I could tunnel through our open box, to get into a closed box were our Subversion (SVN) repository is stored?

My computer --> Open box --> Developer boxes/SVN repository

我无法ssh进入SVN框,但是有没有办法像代理一样使用ssh来访问私有Subversion框?

I can't ssh into the SVN box, but is there a way to use ssh like a proxy to get access to the private Subversion box?

更新:

1.1.1.1->打开框 1.1.1.2-> SVN框

1.1.1.1 -> Open Box 1.1.1.2 -> SVN Box

在打开框后,我可以通过SSH进入SVN框:

I can SSH into the SVN box after I tunnel through the open box:

ssh user1@1.1.1.1
ssh user2@1.1.1.2

这将允许我访问SVN框.我将ssh插入打开的盒子,将SVN盒子的本地前向端口22连接到我的端口22.因此

This will allow me access to the SVN box. I figure, ssh into open box, local forward port 22 of SVN box to my port 22. Thus

ssh user1@1.1.1.1 -L 22:1.1.1.2:22

然后在命令行中使用SVN:

Then using SVN in command line:

svn co svn+ssh://user2@localhost/path

这将返回

svn:网络连接意外关闭

svn: Network connection closed unexpectedly

为什么会这样? svn + ssh是否使用我不知道的其他端口?

Why is this happening? Does svn+ssh use another port that I am not aware of?

推荐答案

是的,您应该能够进行隧道传输.我不确定您在工作时是否使用诸如svn co http://.....之类的内容或诸如svn checkout svn://......

Yes, you should be able to tunnel. I'm not sure if you're connecting to SVN when at work using something like this svn co http://..... or something like this svn checkout svn://......

如果您仅使用svn(不使用apache),我认为您希望通过隧道传输到端口80(如果通过http使用),端口443(如果使用https)和端口3690.所以您的命令应该看起来像这样

I think you want to tunnel to either port 80 (if using over http), port 443 (if using https), and port 3690 if you're using just svn (not using apache). So your command should look something like this

ssh -f user@publicly.accessible.server.com -L 3690:your.internal.svn.server:3690 -N

然后,您应该能够从本地主机中签出/提交/更新/等,就像您的本地主机是svn服务器一样.

Then you should be able to check out/commit/update/etc from your localhost as though your localhost was the svn server.

-f使它进入后台,因此当您希望隧道传输时,您不会看到终端卡在您的公共服务器shell提示符下. -N表示不执行远程命令.

The -f makes it go background so you don't see the terminal stuck at your public servers shell prompt when all you wanted it for was tunneling. The -N says to not execute a remote command.

这篇关于通过隧道进行颠覆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆