Can't connect to my droplet via terminal

July 12, 2018 261 views
DigitalOcean Ubuntu 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 https://www.infobyip.com/sshservertest.php and found that the port 22 is closed, so i 'mt not able to connect to my droplet via ssh

3 Answers

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. https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04 ). If SSH is not listening, you can restart it with one of these commands:

systemctl restart ssh
service ssh restart

Kind Regards,
Jarland

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.
  • no, not responding to ping!

    also i run the command netstat -tulpn and the ssh is listened
    but when i try to ping my droplet its not responding !

    also i have flush my iptables rules with iptable -F

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
dns-namesercers 67.207.67.2 67.207.67.3

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

control-alias eth0

iface eth0 inet static
address 10.16.0.5/16

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 google.com from the console but no response !!

Have another answer? Share your knowledge.