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

August 29, 2018 1k views
Apache Firewall DigitalOcean Ubuntu 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!
Lior

3 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.

        • When I type it “|” it turns it into “>” in the console. Any idea why or how I change it?

          Using macbook.

try:
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 https://status.digitalocean.com and see if there are any known issues in your area.

Also try ssh from console back into your server.

Wayne Sallee
Wayne@WayneSallee.com

  • 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.

    Thanks!

    • 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
      Wayne@WayneSallee.com

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!

Have another answer? Share your knowledge.