I have a ubuntu 12.04 server that I could connect to fine using ssh over the internet. I installed the xubuntu desktop on it, didn't change any settings, then suddenly ssh stopped working.

I can connect locally using "ssh localhost"

I can't connect if I type "ssh (public ip address)"

I can connect using a different computer on the same local network like "ssh"

I double checked to make sure the ports are forwarded correctly, when I use a online port checking tool I can confirm that port 22 is open.

I confirmed that the firewall is off using "sudo ufw disable"

Any other ideas what it might be? Should I just reinstall ubuntu server or is there a obvious thing I'm missing? Any help appreciated or just send me in the right direction, I don't mind reading to figure it out but I don't know where to start, thanks!!!

  • 1
    Please try to run ssh server in debug mode, attempt a connection and edit your question to include the ssh servers debug output. Also, please add the output of the client when using the verbose output option. – soulsource Jul 13 '13 at 12:31
  • This exact thing has happened to me on Ubuntu 20.04. My guess is that by making it a 'desktop' installation it disables a bunch of this stuff by default. – Matthew Rathbone Jun 12 '20 at 13:37

This probably not a ssh config problem if it is working on your local network.

Are you sure ssh is not filtered by a local firewall when you do the check from the outside ? You can try: telnet portquiz.positon.org 22 to test that.

What error do you get? ssh timeout? If it is a timeout this is probably a firewall issue.

You can also check /var/log/auth.log on your ssh server.

Test a telnet yourserverpublicip 22 from outside, and check the output of netstat -anp or tcpdump -ni any port 22

One more idea: some local NAT firewalls do not support NAT loopback so that the connection from outside on your public ip will work, but not from inside your NATed network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.