Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

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)

share|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
add comment

You have to use DNAT.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Reverse SSH if you dont have access to the router

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.