Can ssh internally, but can't externally: port 22: connection refused

1

I'm trying to connect to the my Raspberry Pi over SSH.

I'm able to do it internally (ssh user@raspberrypi), but when I try to connect externally (over public IP) it says:

port 22: Connection refused

I set up port forwarding in the router and disabled the firewall, but still get the same problem. What other causes can there be?

Rizhiy

Posted 2015-12-29T12:35:09.853

Reputation: 111

what is your ListenAddress in your sshd_config? – Jakuje – 2015-12-29T13:01:44.880

it is currently commented out, here is the file: http://pastebin.com/TJSMvH1B

– Rizhiy – 2015-12-29T13:17:28.917

While restarting the Pi I noticed another oddity: when it is shutdown and I try to connect to it internally is says port 22: No route to host, but if I try to connect externally it still says port 22: Connection refused. Is there anything else I need to do in the router apart from port forwarding and disabling firewall? I'm using BT Home Hub 3. – Rizhiy – 2015-12-29T13:41:02.460

If you are able to ssh in the PI locally but not from internet then it could be that the PI doesn't have default route setup. Are you able to ping google.com from the PI? – sebastienvg – 2016-08-11T20:34:15.823

No answers