Report this

What is the reason for this report?

cannot log into Ubuntu 16.04 server with ssh keys

Posted on April 3, 2017

I have completed the tutorials for initial setup of the Ubuntu 16.04 server, LAMP, and Secure Apache with Let’s Encrypt. I was able to log in one time. After I lost my connection through bad wifi my terminal froze. I closed the terminal and could not log back in.

ssh: connect to host hostname.org -p port: Connection timed out

I enabled a pass phrase, but it doesn’t ask it. What could be wrong?



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!

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.

You can access the server if you log into the control panel in DigitalOcean and use the Console.

It’s hard to say what went wrong, but my first guess would be either firewall or you changed the default port 22 of SSH. Which tutorial did you use specifically? And did you do anything outside the scope of the tutorial?

Have you already changed your DNS to point to your server - otherwise continue to use the IP address.

What is the hostname and port?

@technicallyblue Make sure the file /etc/ssh/sshd_config has the line Port 5069 and reboot the server after the change. It seems like you’ve added a firewall rule to block port 22 - at least that’s what I’m seeing when scanning your server:

22/tcp  closed ssh

Remember to click “Reply” under the post or use the @ sign to notify people - otherwise we might miss a message from you.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.