My ssh server is set up on the standard port, and I forwarded the correct port in my router, but I'm still getting a "connection refused" message when trying to connect from the outside. I can connect from the inside just fine.
closed as off-topic by David Foerster, wjandrea, Sumeet Deshmukh, Charles Green, Zanna May 19 '17 at 4:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – David Foerster, wjandrea, Sumeet Deshmukh, Charles Green, Zanna
If you can connect from your local network, Ubuntu most likely has nothing to do with it - it's a network configuration issue.
Many ISPs block incoming connections on "unusual" ports (or all incoming connections). Some ISPs have a setting in their control panel enabling/disabling port blocking.
As a diagnostic - try exposing port 80 (Apache running some webpage) - I'm almost sure you'll find it doesn't work either.
You can also fiddle with modem settings (how do you know you forwarded "the correct port"?), but this would only help after you triple-checked your provider doesn't block you.
For testing purpose, add another non standard listening port (say 2222) in
/etc/ssh/sshd_config file, then do
sudo service ssh restart and forward this port in your router too. Then try to ssh from outside with option