LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-23-2009, 02:02 AM   #1
nikhil010586
Member
 
Registered: Oct 2007
Posts: 44

Rep: Reputation: 15
Subversion (SVN) tunnelling through SSH


Hi,

Writing organised code was way too hectic for me before I found ways to use a subversion repository at my workplace. Things have been a bliss since then.
But however, I can use this repository only from my workplace and not from a machine that's outside the office network. Here, we have a live IP on one server that provides Internet Sharing services to the office LAN. The subversion repository is physically located on another machine that's accessible through normal svn://local-IP/<svn-path>.. like URLs within the LAN.

Now I've read in the svnbook that SSH tunnelling is possible and the repository shall be accessible via svn+ssh://... URLs.
The SVN server here is using svnserve with authentication and the live IP has sshd running, thus enabling us to remotely access it via SSH.

Can anybody please provide a quick HOWTO regarding server configurations on both the machines so that the Subversion repository becomes accessible through the internet? This shall facilitate an effective code management and working from home networks.
 
Old 01-23-2009, 07:29 AM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
So the SVN server is on a different machine to the machine with the live IP?

From home, login to the live machine using ssh port forwarding like...
ssh -L 3690:svnserverip:3690 liveip

Change "svnserverip" to the ip address of the svnserver at work, and change "liveip" to whatever you use to login to work from home.

Then from the home machine access the svn server like...
svn://127.0.0.1/<svn-path>

If you're using windows at home you can get "putty" and add the svnserver's details into the tunneling section.
 
Old 01-23-2009, 08:39 AM   #3
nikhil010586
Member
 
Registered: Oct 2007
Posts: 44

Original Poster
Rep: Reputation: 15
Thanks niknah, that worked like a charm!

Now if I don't want to expose my local svn server for some reasons, or lets say, I want to access my svn server through this live IP by directly specifying the Live IP in SVN URLs. The whole idea behind this stuff is that I want to abstract the SVN server from outer networks. I hope there's a direct tunnelling possible so that I can access my repos through svn+ssh://... URLs. Some configurations need to be performed on the server side for that but I'm not sure of those.
 
Old 01-23-2009, 09:14 AM   #4
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
On the live IP machine, you need to setup iptables so you can login to the svn server directly...

iptables -A PREROUTING -p tcp --dport 24 -j DNAT --to-destination svnserverip:22

After this you should be able to run "ssh -p 24 liveip" from home and login to the svn server.

The problem with the svn+ssh:// protocol is that they won't let you set the port number, before using svn you have change the port number by running...
export SVN_SSH="ssh -p 24"
 
Old 01-23-2009, 11:18 PM   #5
nikhil010586
Member
 
Registered: Oct 2007
Posts: 44

Original Poster
Rep: Reputation: 15
okay!
Thanks a lot for all your help..! I'll do it with the normal SSH tunneling!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SVN: Is it possible to commit to multiple Subversion repos? nathacof Linux - Software 1 07-22-2007 08:15 PM
Subversion / Tortoise SVN problem outshined Linux - Software 1 06-08-2006 12:41 PM
Subversion (svn) client for Slackware? shilo Slackware 1 08-22-2005 06:05 PM
subversion(svn) faezeh Fedora 0 05-13-2005 07:59 AM
svn (subversion) Unrecognized URL Scheme chis Linux - Software 0 09-18-2004 08:02 PM


All times are GMT -5. The time now is 11:40 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration