How can I setup subversion with ssh tunnel in Eclipse?
Asked Answered
M

4

8

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.

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

Myocarditis answered 25/1, 2009 at 23:14 Comment(2)
Are you sure Eclipse can't deal with such URIs'? svn+specialssh:// should be valid for it.Weltschmerz
Are you really using a tunnel or is the problem just the non-standard port for ssh?Mcdowell
A
7

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.

Then in Eclipse, I configure the repository:

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.

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

svn+ssh://host:port/directory
Aviatrix answered 25/1, 2009 at 23:32 Comment(0)
M
5

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

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.

Mcdowell answered 26/1, 2009 at 11:21 Comment(1)
This worked for CL connections, but not for eclipse using svn+ssh://svnserver/path/to/svn/repo as the URL with subeclipse 1.6.Owings
G
2

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

#!ssh1234.sh
ssh -P 1234 $*

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

export SVN_SSH=$HOME/scripts/ssh1234.sh
Greg answered 25/1, 2009 at 23:23 Comment(1)
Where do you tell eclipse to use that instead of ssh?Myocarditis
D
1

svn+ssh://host:port/directory

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

my way of setting up subversion:

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

Daystar answered 10/8, 2011 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.