-   Linux - Networking (
-   -   SSH port forwarding thru a NAT Firewall (

whoever 07-27-2005 06:03 PM

SSH port forwarding thru a NAT Firewall
I have tried this SSH port forwarding thru a NAT Firewall but I just don't get it. I guess that's why I'm called a NOOBY.
I have been able to SSH from my companies PC to my home PC using Telnet port 23.
Ultimately I'm trying to VNC from work to my home PC using tunneling.

THnx you guys

mpeg4codec 07-27-2005 08:36 PM

Are you sure it's SSH, if you're using port 23?

The easiest way to be able to do this is to use SSH's built-in port forwarding. The syntax is -L localport:remotehost:remoteport. So for instance, if you use this command:

ssh -L 5902:localhost:5900 user@your.home.pc

you will be able to connect on port 5902 on localhost which will then be tunneled to your home PC's port 5900. In this case, the ``localhost'' in ``5902:localhost:5900'' refers to the fact that it's connecting to the machine you've SSH'd into.

To connect to your home computer's VNC server, all you must do is fire up your VNC client and connect to localhost:2 [or just :2] since 5902 is VNC display number 2.

Let me know if you have any more trouble.

whoever 07-28-2005 06:53 PM

Thnx.. I appreciate your help.

The reason I use port 23 is because behind our firewall I know this port is open. Some ports aren't open. I use the SSH app called putty from a WinXP PC connecting to my Fedora 4 PC @ home.

I tried the ports use suggested but it still doesn't work.

RedHatCat 07-29-2005 03:24 AM

To ssh into my home machine, I simply set up port forwarding on my router (or "Virtual Networks" I think my router calls it) - so that it forwards requests on port 22 (default ssh port) onto the IP of my RHES machine.
Then I just ssh to my external IP.

I guess you will need to configure your sshd_config to use port 23 (and specify the port on your client too) if thats all you have open on the router - easier just to change the router to forward 22 tho. Good luck :)

*as far as VNC goes, I'm not very knowledgable. I'd get an X-server for your windows machine (and enable X-tunnelling on your ssh client) and simply call gui programs fom the command line.

All times are GMT -5. The time now is 10:26 AM.