LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2009, 02:28 PM   #1
JustinKubicek
LQ Newbie
 
Registered: May 2009
Posts: 9

Rep: Reputation: 0
Port forwarding: Directing traffic to a ssh client


Hello everyone,
I'll give you all of the information I have. I'm using UVNC and SingleClick, so far I've gotten it all to work correctly. Here how things work so far, the user downloads the server and it connects to a viewer that is listening on xxx.xxx.xxx.xxx:5500. My problem is that I might be at yyy.yyy.yyy.yyy behind a router. I was wounding it I could open the port on my machine (yyy.yyy.yyy.yyy) and bring that port to xxx.xxx.xxx.xxx:5500, so when the user opens their server to connect to me, xxx.xxx.xxx.xxx forwards all of the traffic to my viewer at yyy.yyy.yyy.yyy:5500. I know that this concept does not only apply to UVNC, so you answers do not need to be specific. Also, there might be a chance that I'll be viewing from a windows machine so I might need to use cygwin or putty. I've gotten it to work part way if I use ssh -g -R *:5500:72.15.37.156:5500 root@host, but only the remote machine has access to the port, I need other machines to be redirected.

thank you for all of your input!

Justin
 
Old 05-29-2009, 12:20 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
The viewer uses random non service ports 1024 to 65535. There is no way to tell what port the viewer is using - it picks them randomly. The server uses only one port 5500 (Usually 5900 or 5800). VNC is simple - clients connect to server. What exactly are you trying to do?
 
Old 05-29-2009, 03:43 PM   #3
JustinKubicek
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your response. The whole thing gets confusing with SingeClick and VNC, but I can try to explain it in a different way. Lets say I have a domain name, example.com, that points to node1, and I'm at node2. Node1 isn't running a webserver, but I have one running at node2. I want to connect to node1 with node2 using ssh, so when someone visits example.com they see the website that is located at node2. I hope this makes more sense.

Thanks again,
Justin
 
Old 05-29-2009, 03:48 PM   #4
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
Port forwarding, its in your router config
 
Old 05-29-2009, 08:35 PM   #5
JustinKubicek
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thats how I do it now... The idea here is if I'm at a hotel, or dialing to the internet using a cell phone, etc.

As an update I've gotten it to work using a reverse ssh tunnel. Here is the command:

ssh -R *:80:*:80 host1

The problem now is the only computer that can acess the port on the remote machine, is the remote machine. I need other computers to be able to connect to the remote machine.

Thanks...this whole thing is starting to work.

Justin
 
Old 05-31-2009, 12:00 PM   #6
JustinKubicek
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I got it working I had to enable GatewayPorts in /etc/ssh_config and /etc/sshd_config...as layed out in this document, under "Port Forward Security". Thanks for everyone's help!

I wrote a blog post about this at http://www.justinkblog.com/2009/06/u...ile-youre.html.

Last edited by JustinKubicek; 06-02-2009 at 05:18 PM.
 
  


Reply



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 Port Forwarding dylans Linux - Software 1 01-09-2009 10:28 PM
Port Forwarding from Router to Client expatCM Linux - Networking 0 08-06-2008 05:38 AM
ssh port forwarding simpl Linux - Software 3 07-20-2006 01:41 AM
port 25 forwarding iptables FC4, can't get it to pass traffic sahib2u Linux - Security 4 03-01-2006 10:00 AM
Directing Traffic on 2 LAN Cards Xing Linux - Networking 2 08-17-2005 02:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:42 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
Open Source Consulting | Domain Registration