LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH not working externally (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-not-working-externally-684413/)

Ryan_Sutton 11-18-2008 04:04 PM

SSH not working externally
 
Hello, trying to SSH in to my fedora 9 computer and am having trouble. My Linux computer is on a private (NAT) network behind a Linksys. I have a few other computers on this network, all windows boxes. From any of the Windows boxes I can SSH (using Putty) in to my Linux box.

When I try to SSH to my Linux box from work or my friends house, I am not able to, the connection times out. I have forwarded all TCP traffic on port 22 from the WAN interface on my router to the private IP of my Linux box. This is the only setting I know of to allow external SSH access to my network. Can anyone offer further troubleshooting?

Thanks,
Ryan

acid_kewpie 11-18-2008 05:02 PM

it sounds like there is possibly some firewall config as well as the NAT config, but a good point to start (in my world at least) is to run tcpdump or wireshark on your ssh server and watch what packets hit it. if your internet connection is working from the box, then there's no reason everything on that box shouldn't be fine so must on the router. also check out portforward.com to step you through config for your router (probably)

centos82 11-18-2008 05:25 PM

Also, and this may be a duh, but remember when you ssh externally you have to ssh to the public IP of your router and not your servers IP.

tredegar 11-18-2008 05:44 PM

Try ssh -vvv user@YOUR.PUB.LIC.IP
ssh will report what it is trying to do, what is happening, and (probably) why it is failing.
See man ssh for more details.

Ryan_Sutton 11-18-2008 05:45 PM

Thanks for the feedback. I will run Wire Shark on my Linux box to see if I am even hitting it. I can't imagine needing a guide for the firewall, I simply allowed all WAN facing TCP traffic on port 23 to go directly to the private NAT IP of my Linux box. Maybe the firewall is glitching? Does OpenSSH inherently deny public IP address? I've also allowed all TCP traffic on port 23 in IPtables.

When I am connecting over the internet I am putting the public IP address in Putty, not the private.

tredegar 11-18-2008 05:52 PM

Wireshark? I don't think you need that for this level of troubleshooting.
Quote:

I simply allowed all WAN facing TCP traffic on port 23....
ssh defaults to port 22
Maybe that is where your problem lies.

Ryan_Sutton 11-18-2008 06:01 PM

23 was a typo =]

Anyways, I just SSH'ed from my Linux box here at work and suprisingly enough, it worked! The only thing I've done since I last tried is reboot the SSH Linux server at my home. Apparently something in the reboot fixed the problem.

Thanks all for your help!

** Good to see you are still around Acid, you were helping me back in 2002 when I was trying to setup a Slackware/Samba setup. Cheers!


All times are GMT -5. The time now is 08:13 PM.