Cant ssh into server

I setup a new droplet about 36hrs ago and followed the tutorials here on DO to create the ssh keys for my local computer. I logged out and then back in after to make sure it worked and I must have logged out and back in a few times after that.

Today however when I run ‘ssh myusername@myserverip’ nothing happens, the cursor moves to a new line and just sites there, no error message is given and Im not prompted to do anything else. Ive tried new terminals as well as restarting and still the same. I can see the .ssh folder in my main user directory on my computer (ubuntu) and in that there are the following files

known_hosts my-ssh-key

these all seem to have the keys in too.

What is the problem here?

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.

From droplet console

sudo ufw disable sudo ufw allow ssh

and try ssh login. After login

sudo ufw enable sudo ufw status

You should see:

Status: active To Action From

Apache Full ALLOW Anywhere 22 ALLOW Anywhere Apache Full (v6) ALLOW Anywhere (v6) 22 (v6) ALLOW Anywhere (v6)

Port 22 is ssh port and it is allowed now.

Monday Sept 10 – just to confirm a simple solution to SSH not working with Firewall

Firewall will not allow SSH login unless the firewall has been set to allow SSH. To set the firewall correctly : login to droplet sudo ufw disable sudo ufw allow ssh sudo ufw enable

The sudo app list does not change. BUT the SSH login (eg via Putty using SSH keys) will then work fine. For me this has only happened with 16.04

Go to your droplet and click on Power on. that worked for me