Used to be able to ssh into droplet, now operation times out

Posted August 29, 2018 3.1k views
ApacheDigitalOceanFirewallUbuntu 16.04

Hi everyone,
My droplet was working just fine and I was able to connect to it through my mac and through my phone using ssh port 22 and all of a sudden it started giving me errors.
First it was Connection refused and then after I restarted the machine it is now giving me Operation timed out.
I turned the firewall off using ufw disable but still nothing changed.
Any idea on what might caused it? I didn’t do anything and all of a sudden it started doing it after 2 years I have the droplet.
Thanks so much!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

I am able to log in through the console but not through ssh port 22.

Also tried an older backup of the droplet but that didn’t work either.

Any other suggestions?

Thanks so much!

  • Check if the ssh daemon is running and if it doesn’t try reinstalling it. It’s a fairly easy task and all the info can be found on google(OS restart ssh daemon/OS reinstall ssh daemon). Sorry, i’m on a bus and it’s pretty bumpy or i would have provided examples.

    • Hi X40C,
      Thanks for the suggestion.
      I tried it but still nothing. “Connection refused”. Also, it won’t work not on my iphone nor on my laptop. Only through the DO console.
      Any other ideas?
      Thanks so much!!!

      • “Connection refused” usually means that there is nothing listening on the given port. Either cat /etc/ssh/sshd_config | grep Port or nano /etc/ssh/sshd_config and check for a line stating Port xxx(Should be #Port 22). You might also want to run ss -nlput | grep sshd which will tell you if the ssh daemon is running and the port it’s listening on.

tail -F /var/log/auth.log

Then try to log in again with ssh.

Also try logging in from a different IP address, as there might be a router, or server between you and DO causing a problem.

Check and see if there are any known issues in your area.

Also try ssh from console back into your server.

Wayne Sallee

  • Hi Wayne,
    Thanks for the reply!
    I tried the command you suggested and it went into a loop. Here is the screen picture - Link
    I also now noticed that the error message changed from “Operation timed out” to “Connection refused”. I don’t know if it’s related or not.


    • Yes, the tail command is designed to follow the log. When you are done with it, press ctrl c.

      The log shows cron login and out, but not you logging in or out.

      Now, without the tail command, try ssh from tty back into your server with the command you usually use, such as:

      ssh UserID@IPAddressOrDomainName

      If you use a different port other than 22, then:

      ssh -p 2222 UserID@IPAddressOrDomainName

      Use your your own user at domain, and port if you use a different port.

      Wayne Sallee

When I check “service ssh status”, I get “ssh start/running” but without any port number.
Also, the “sshd_config” is completely empty.
Any thoughts on where I go from here?
Thanks so much!

For anyone that runs into this issue - you may have forgot to run ufw allow OpenSSH as root during initial server config.