Results 1 to 8 of 8
Hi all,
I have a home server running Debian Squeeze. This server is behind a router with a static IP.
To access the apache server, in the router I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-18-2012 #1Just Joined!
- Join Date
- Feb 2012
- Posts
- 4
Access server from outside LAN via SSH
Hi all,
I have a home server running Debian Squeeze. This server is behind a router with a static IP.
To access the apache server, in the router I have redirected port 8888 (public) to port 80 (private) so when I type xxx.xxx.xxx.xxx:8888 (where the x's represent the router's static ip address) in a web browser from outside the LAN, it displays a home page. That works just fine.
Now I would like to access the ssh server from outside the LAN. To accomplish this, in the router I redirected port 1982 to the server's (private) port 22, but I keep getting a "Connection timed out" message in Putty while trying to connect to the server.
Some things to consider:
1) the sshd daemon is running on the server.
2) Iptables is not blocking any incoming connections (just to test, it's configured with an ACCEPT ALL policy).
3) The Putty connection is xxx.xxx.xxx.xxx:1982 (where the x's represent the same IP address as above).
4) I already checked linuxquestions.org/questions/linux-newbie-8/ssh-access-from-outside-the-lan-176986/ where a suggestion is given but I am not quite sure as how to implement it.
I hope I have asked this question the smart way. Any suggestions / ideas are more than welcome!
- 07-18-2012 #2Linux Enthusiast
- Join Date
- Apr 2012
- Location
- Virginia, USA
- Posts
- 573
Shot in the dark here, but maybe try a higher port number, such as 8889.
Also, you can try to telnet to that IP and port with telnet. You should get a connection. This will tell you if it's your putty settings, etc.
Other settings: Make sure you sshd_config file doesn't have a white list, as this will disallow all other connections. Also check hosts.allow file.
- 07-18-2012 #3Just Joined!
- Join Date
- May 2007
- Posts
- 16
- 07-18-2012 #4Just Joined!
- Join Date
- Feb 2012
- Posts
- 2
Hi.
there is a configuration where you can specify that the connection incoming become from a redirection port.
you can find this configuration from the man page's, just type in a terminal "man ssh" I don't remember exactly what configuration's file is.
cheers.
- 07-19-2012 #5Just Joined!
- Join Date
- Dec 2011
- Location
- Seattle, WA
- Posts
- 7
Make sure you can connect from a local network to the ssh port first.
Since you can connect the web port without any problem, it doesn't sound like a port-forward issue at least.
- 07-19-2012 #6Just Joined!
- Join Date
- Apr 2006
- Location
- San Jose, CA, USA
- Posts
- 6
It is possible the problem is network rules where you are trying to connect from. My company, for example doesn't allow outbound connections to ports above 1024.
- 07-19-2012 #7Just Joined!
- Join Date
- Feb 2012
- Posts
- 4
I forgot to mention that ssh within the LAN works just fine.
Yesterday when I got home I changed the public port to 22 (which is forwarded by the router to private port 22) and it worked! There must have been something wrong with public port 1982 I guess - it was open in the router but it was not forwarding traffic to the LAN.
Any ideas why? The router is a Dlink-600. Anyway, I'll mark this as solved, but additional insights are always welcome, so feel free to keep 'em coming.
- 07-19-2012 #8Just Joined!
- Join Date
- Feb 2012
- Posts
- 4
Also, thank you all guys for taking the time to write and provide some very helpful ideas!


5Likes
Reply With Quote

