openSUSE Forums > Programming/Scripting » Need help with svn

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read

Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-Nov-2008, 17:22
castord's Avatar
Student Penguin
 
Join Date: Jun 2008
Location: As. - Paraguay - GMT -4
Posts: 95
castord hasn't been rated much yet
Default Need help with svn

Hello guys.
Is there a way to forward petitions to one box to another to make use of its public ip in certain ports.
I want to public my svn repository (located in a LAN network) to checkout, commit or update from remote places but I can't get a public ip and I only have access to an opensuse 10.3 with the public ip that I need. In normal cases port forwarding in the router configuration will solve my issue but this time is harder .

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 05-Nov-2008, 17:58
Student Penguin
 
Join Date: Jun 2008
Location: Amor, Leiria, Portugal
Posts: 55
m4ktub hasn't been rated much yet
Default Re: Need help with svn

Maybe you could use ssh to do some port forwarding. From the machine with the SVN server you probably could open a public port somewhere with
Code:
ssh -R <public port>:localhost:<svn port> <ip>

Last edited by m4ktub; 05-Nov-2008 at 17:59. Reason: typos
Reply With Quote
  #3 (permalink)  
Old 06-Nov-2008, 12:45
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 39
rhasselbaum hasn't been rated much yet
Default Re: Need help with svn

Yes, SSH can definitely do this. I saw a very good tutorial from Red Hat that walks through common setups. (Applies to openSUSE as well.) They also posed a follow-up article that is equally helpful.
Reply With Quote
  #4 (permalink)  
Old 07-Nov-2008, 07:30
castord's Avatar
Student Penguin
 
Join Date: Jun 2008
Location: As. - Paraguay - GMT -4
Posts: 95
castord hasn't been rated much yet
Default Re: Need help with svn

you're right, it was very useful. I'll try to implement it now.

thank you.
Reply With Quote
  #5 (permalink)  
Old 12-Nov-2008, 07:23
castord's Avatar
Student Penguin
 
Join Date: Jun 2008
Location: As. - Paraguay - GMT -4
Posts: 95
castord hasn't been rated much yet
Default Re: Need help with svn

I finally give up trying to 'ssh tunneling' and I come here to ask for help again.
Apparently I can't make double forward inside my LAN.
SVN is in A (LAN),
Public IP is in B (LAN),
Final Target (remote PC) is in C (WAN, Internet).
I forwarded port 3690 (SVN port) of B to 3690 of A.

In B
Code:
ssh -L 3690:A_IP:3690 root@A_IP
After this I am able to do in B:
Code:
svn ls svn://localhost
till this point everything works fine.

Then I tried the following:

In C:
Code:
ssh -L 3690:B_IP:3690 root@B_IP
And when I run (always in C):
Code:
svn ls svn://localhost
I get:
Code:
svn: Connection closed unexpectedly
And in STDOUT of B ssh prints:
Code:
channel 3: open failed: connect failed: Connection refused
I also tried:
In B:
Code:
ssh -R 3690:C_IP:3690 root@C_IP
but I get just the same error message

Code:
svn: Connection closed unexpectedly
If there is no svn port open and listening this should be the error message:
Code:
svn: Can't connect to host 'localhost': Connection refused
So I don't know what is wrong. Maybe port was opened but svn of A is not responding or refuses forwarded connections. I don't know, I'm just guessing.

I hope somebody can help me.

Thanks.
Reply With Quote
  #6 (permalink)  
Old 13-Nov-2008, 05:30
Student Penguin
 
Join Date: Jun 2008
Location: Amor, Leiria, Portugal
Posts: 55
m4ktub hasn't been rated much yet
Default Re: Need help with svn

Hi,

In C (with the configuration before "I also tried...") try
Code:
ssh -L 3690:localhost:3690 root@B_IP
My guess: When SSH forwards a port, by default, it only allows local connections to that port. By using B_IP instead of localhost you are using the public interface and the connection is refused. Thats why you could access "svn://localhost" but cannot access "svn://B_IP".

Disclaimer: This guess is based on the weather conditions in Portugal and the particular taste of this morning's coffee so it may be off.
Reply With Quote
  #7 (permalink)  
Old 13-Nov-2008, 06:48
castord's Avatar
Student Penguin
 
Join Date: Jun 2008
Location: As. - Paraguay - GMT -4
Posts: 95
castord hasn't been rated much yet
Default Re: Need help with svn

It works!!!!!!

obrigado!
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.2