Can't connect to my droplet via terminal

Posted July 12, 2018 9.8k views
DigitalOceanUbuntu 16.04

Hello guys
i’m not able to connect to my droplet via SSH , i can access it via the console in the dashboard, also i checked a online tool and found that the port 22 is closed, so i ‘mt not able to connect to my droplet via ssh

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
6 answers

i am fed up from this to be honest :S

have a similar problem. Any advice?

Hello friend!

Is your droplet responding to ping? If so, it sounds like at least one of these things may be true:

  1. Your SSH port was changed from 22 to something else
  2. SSH is not listening
  3. The firewall on your droplet is blocking the SSH port

Depending on distro and version of OS, you may be able to type “netstat -tulpn” in console to see what services are listening, and you should see SSH on there. You can manage firewall with iptables (ex. ). If SSH is not listening, you can restart it with one of these commands:

systemctl restart ssh
service ssh restart

Kind Regards,

by Justin Ellingwood
The iptables firewall is a great way to secure your Linux server. In this guide, we'll discuss how to configure iptables rules on an Ubuntu 14.04 server.

here is the output of cat /etc/network/interfaces.d/50-cloud-init.cfg

network config: disabled ( i tried to change ot to enabled and reboot but nothing change still no network)

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address <myip/20>
gatway <gateway>

control-alias eth0

iface eth0 inet static

output for ip addr / ip route

Example link

output of iptables -nvL:
Example link

Also there is no network connection in the server when i opened it via console i tried to ping to from the console but no response !!

I had a simillar issue, i later realized port 22 was closed, i enabled it with
$sudo ufw allow 22

and it worked.