LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 10-26-2009, 09:42 PM   #1
dynamics
LQ Newbie
 
Registered: Aug 2009
Location: Guildford
Distribution: Ubuntu Jaunty
Posts: 12

Rep: Reputation: 0
Reverse Tunneling / Reverse port forwarding in SSH


Friends,
I want to know how to do reverse port forwarding or reverse tunneling using SSH.
Reason: I have set up VNC server in my lab system (labby) and want to work on that, from hostel, using my laptop (noty). Needless to say the labby is behind firewall (131.x.y.z).

I have set up a VNC viewer in my noty to work on labby through VNC. I can establish a SSH connection to my Lab using this tunnel forwarding method.

# ssh -L 5900:labby:22 131.x.y.z -l user_name_in_labby
Password:
Then in another new terminal
# ssh -Y 127.0.0.1 -p 5900 -l user_name_in_labby
Password:

The first command is to set up a local host in labby and second command is to connect to that using my noty's port 22 (please correct me if I am wrong, I am a mechanical engineer)

But now I want to do reverse tunneling. I searched several tips from google and failed to find the answer to the case I wanted.
Please refer the attachment to see the network diagram (vnc_rpf.png

What I want is reverse port forwarding from labby and listening in noty.
Means my noty should listen to labby using a ssh command in my noty.

Thanks
Attached Images
File Type: png vnc_rpf.png (55.4 KB, 10 views)
 
Old 10-27-2009, 10:59 AM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,520

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
To achieve your goal, I think that you should consider using FreeNX with a reverse SSH tunnel.
This link is for FreeNX (note the Enable reverse connections under Advanced topics). http://openfacts2.berlios.de/wikien/...t:FreeNX_-_FAQ
This link is what I used to set up the reverse SSH tunnel that I use. It contains a script that can be run as a cron job to bring up the tunnel at specified times. You may want to adapt the script for your needs.
http://www.brandonhutchinson.com/ssh_tunnelling.html
 
Old 10-27-2009, 03:03 PM   #3
dynamics
LQ Newbie
 
Registered: Aug 2009
Location: Guildford
Distribution: Ubuntu Jaunty
Posts: 12

Original Poster
Rep: Reputation: 0
Thank you very much.
I will try this.
Regards
 
Old 11-23-2009, 11:31 AM   #4
thenetking
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
I don't know if I follow your setup 100% because I am here looking for details on something a little different. But, I will explain how I would get vnc to work the way I think you're looking to do.

On the machine behind the firewall, start an ssh tunnel outbound to your home computer with a command something like this:

ssh -R 127.0.0.1 -p 5900 -l user_name_in_labby

-R is setting up a reverse port, when you access localhost:5900 in vnc in your home computer, it will go backwards through the tunnel you started from labby and access labby's port 5900. I home this is atleast something you're looking for.

Now if I could just figure out how to get a port being forwarded to a computer to get sent through the reverse port tunnel I would be in good shape :/
 
  


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
ssh tutorial, for reverse tunneling for vinagre & sftp manwithaplan Linux - Networking 1 11-02-2009 10:52 PM
Reverse,Port Forwarding via SSH and connecting from two different location metallica1973 Linux - Networking 2 12-20-2008 05:42 PM
LXer: Reverse SSH Tunneling LXer Syndicated Linux News 0 09-19-2008 03:21 PM
SSH tunneling/port forwarding cougem Linux - Networking 1 06-30-2006 07:06 AM


All times are GMT -5. The time now is 12:25 AM.

Main Menu
Advertisement
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