Question

SSH Error: Connection refused after 'sudo reboot'

I am running a MySQL server on Ubuntu 14.04 LTS (vmlinuz-3.13.0-52-generic). I had run the following via SSH, and, after a reboot of the Droplet, I can no longer connect via SSH:

sudo apt-get update sudo apt-get upgrade Saw a message about restart required sudo reboot

When I SSH:

~ $ ssh xxxxxxxxx@###.###.###.### ssh: connect to host ###.###.###.### port 22: Connection refused

My /etc/ssh/sshd_config file is set to receive connections on port 22, I have not changed this.

Steps I’ve taken:

I tried to power cycle my Droplet via the Digitalocean control panel and am still receiving the same error when I attempt to SSH into my Droplet.

I have attempted to gain console access via the Digitalocean control panel, but I am not receiving a command prompt, only the following (it just sits there):

Ubuntu 14.04.2 LTS hostname tty1 hostname login: Cloud-init v. 0.7.5 running ‘modules:final’ at Thu 09 Jul 2015 18:09:29 +0000. Up 5.85 seconds Cloud-init v. 0.7.5 finished at Thu 09 Jul 2015 18:09:29 +0000. Datasource DataSourceDigitalOcean. Up 5.93 seconds

Any ideas?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I wound up here with the same problem, minus the console issue. This SO answer may fix the ssh problem for those in the same boat. “By default, the SSH server denies password-based login for root.”, so you’ll have to change that to suit your needs.

This question was answered by @jtittle:

@acamp120 When attempting to login remotely, try using:

ssh -v [username]@[ipaddress] …

ssh -vv [username]@[ipaddress] …

ssh -vvv [username]@[ipaddress] …

What this does, essentially, is increase the verbosity of what is output when attempting to connect via SSH. This will give you an idea of what’s going on during the back and forth exchange. Start with -v, then -vv and finally -vvv (as -vvv will throw about a page and a half of output at you).

You can also check /root/.ssh/known_hosts (on your local machine - if using Linux). You can clean that specific file out and then attempt to reconnect. It’ll ask you to confirm that you’d like to add the host you’re connecting to (to the known_hosts file). I’ve had plenty of instances which required this over the years as small changes (regeneration of server keys, for example), can invalidate your connection (though you’ll normally receive a message in such a case).

Beyond that, was a firewall active (i.e. iptables or UFW)? If so, and your IP wasn’t whitelisted, it’s possible your connection is being blocked. You should still be able to get in through console though.

View the original comment