Trying to ssh to my droplet : port 22: Connection timed out

November 3, 2014 5.4k views

I’ve created a new droplet using a image. I’m trying to connect to it through ssh but I’m getting a port 22: Connection timed out error.

I’ve tried rebooting the system through the DO console.

I’ve tried the following:

sudo apt-get install openssh-server
sudo apt-get install openssh-client

/etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d use the service(8) utillity, e.g. service ssh start
 Since the script you are attempting to invoke has been converted to and Upstart job, you may also use the start(8) utillity, e.g.e start ssh


sudo service ssh status
/lib/init/ upstart-job: 28 : shift: can't shift that many

sudo service ssh status
ssh start/running, proces 1702

When I go to the ip adres I get forwarded to the website.

2 comments
2 Answers

Hello, @alucardu

If you’re able to access your droplet using the console from the control panel you can check if the ssh service is running using:

service sshd status

if the service is stopped/dead you can start it:

service sshd start

Also you can check if something else have taken the ssh port using netstat:

netstat -plunt | grep ssh

and

netstat -plunt | grep 22

If you’ve made changes to your ssh configuration (e.g switched ports) you should check for the port which is used from sshd

Hope this helps!

Regards,
Alex

Have another answer? Share your knowledge.

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