I have linux server behind NAT but i can farward the port to LAN computer.

How can do that so that at least i can ssh

link|improve this question
feedback

4 Answers

up vote 2 down vote accepted

The standard port for ssh is 22.

You have to tell your router to forward a port (22, tcp) to your linux machine's IP. This is usually in a section called 'NAT' or 'Servers' in your router's configuration.

Most OSs have a firewall installed as standard. So you may have to open port 22 on your server machine's software firewall as well. (try 'ipkungfu' for a fairly simple interface to set up a linux firewall)

link|improve this answer
Don't forget the part about setting your server to a static IP internally. Otherwise you'll risk eventually having the machine "disappear" after coming back up from a power outage. – Bart Silverstrim Apr 30 '10 at 11:22
A static IP outside the DHCP pool, that is. – Bart Silverstrim Apr 30 '10 at 11:22
feedback

You have to use DNAT.

link|improve this answer
feedback

On the device which is doing the NAT you need to setup port forwarding.

This will forward incoming traffic on the chosen port to a particular server behind the NAT device.

How you set this up will depend on what device it is.

link|improve this answer
feedback

Reverse SSH if you dont have access to the router

link|improve this answer
feedback

Your Answer

 
or
required, but never shown