Port forwarding: Directing traffic to a ssh client
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.