如何在 Eclipse 中使用 ssh 隧道设置颠覆?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/478498/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:36:08  来源:igfitidea点击:

How can I setup subversion with ssh tunnel in Eclipse?

eclipsesvnsshsubclipse

提问by MikeN

I have a remote server that hosts my subversion repository on a non-standard ssh port. I want to use Eclipse's subclipse plugin as my client end to access the SVN repository. I can access the repository fine by using svn+specialssh://... where specialssh is a tunnel profile setup in my ~/.subversion/config.

我有一个远程服务器,它在非标准 ssh 端口上托管我的 subversion 存储库。我想使用 Eclipse 的 subclipse 插件作为我的客户端来访问 SVN 存储库。我可以使用 svn+specialssh://... 访问存储库,其中 specialssh 是在我的 ~/.subversion/config 中设置的隧道配置文件。

In subclipse I tried to input the URL of the repository as: svn+specialssh:// but that doesn't work.

在 subclipse 中,我尝试将存储库的 URL 输入为:svn+specialssh:// 但这不起作用。

采纳答案by Don Branson

First, I set up my tunnel to my repository, which lives behind the firewall on my home network:

首先,我设置了我的存储库的隧道,它位于我家庭网络的防火墙后面:

ssh -L 9000:10.5.128.5:3690 root@<mypublicallyexposedaddress>

10.5.128.5 is the internal address of my repository host. Port 3690 is where svn listens.

10.5.128.5 是我的仓库主机的内部地址。端口 3690 是 svn 监听的地方。

Then in Eclipse, I configure the repository:

然后在 Eclipse 中,我配置存储库:

svn://localhost:9000/gwt

And there you go. This is not the only way to do it. I've also use an approach where Eclipse has to know it's ssh, and the plugin has to support it, which they do, but this approach is just my personal preference.

你去吧。这不是唯一的方法。我还使用了一种方法,其中 Eclipse 必须知道它是 ssh,并且插件必须支持它,他们确实这样做了,但是这种方法只是我个人的偏好。

On second thought, you don't need anything that complicated. Try:

再想一想,你不需要那么复杂的东西。尝试:

svn+ssh://host:port/directory

回答by innaM

Add the ssh connection configuration to your ~/.ssh/config file:

将 ssh 连接配置添加到您的 ~/.ssh/config 文件中:

Host svnserver
    HostName your.real.hostname.here
    Port 1234
    User you

If you then specify "svnserver" as the hostname in any ssh/svn+ssh configuration, ssh should be able to resolve everything by simply reading your config file.

如果您随后在任何 ssh/svn+ssh 配置中指定“svnserver”作为主机名,ssh 应该能够通过简单地读取您的配置文件来解决所有问题。

回答by orip

Something I used to do is have a shell script wrap my access to SSH, something like:

我以前做的事情是用一个 shell 脚本来包装我对 SSH 的访问,例如:

#!ssh1234.sh
ssh -P 1234 $*

And I'd tell my Eclipse svn plugin to use that script instead of "ssh", by setting the SVN_SSHenvironment variable:

我会通过设置SVN_SSH环境变量告诉我的 Eclipse svn 插件使用该脚本而不是“ssh” :

export SVN_SSH=$HOME/scripts/ssh1234.sh

回答by dwaver

svn+ssh://host:port/directory

svn+ssh://host:port/directory

-> works 4 me like charm on debian server out of eclipse (flash builder 4.5) thanks Don Branson

-> 4 me like 在 Eclipse (flash builder 4.5) 之外的 debian 服务器上工作,感谢 Don Branson

my way of setting up subversion:

我设置颠覆的方式:

http://dwaver.files.wordpress.com/2011/08/subversion-notez-v1-0.pdf

http://dwaver.files.wordpress.com/2011/08/subversion-notez-v1-0.pdf