Question

port 22: Connection timed out

Today, I have established a droplet succesfully. The information: 162.243.159.46 512MB Ram 20GB SSD Disk San Francisco 1 CentOS 6.7 x64

Gateway: 162.243.152.1

However, when I try ssh root@162.243.159.46 The error occurred: ssh: connect to host 162.243.159.46 port 22: Connection timed out

Also, when I try ping 162.243.159.46 It failed to connect to the server

But, I can connect to the gateway. ping 162.243.152.1 is successful.

How can I solve this problem.

Thanks very much.

Best wishes

Zaixu

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.

Not sure if anyone needs anymore discussion on this, but I faced the same problem and got a lead from this post to fix. Yes, I think port was blocked. When I did sudo ufw allow 22 from console and tried to connect, I was able to connect

Awesome SO I HAVE SOLVED THIS.

Login to your digital ocean account and go to launch console under access in your droplet. then type in your username and then your password.

Once you are logged in type $ sudo ufw allow 22

Try again in your terminal and it will work. :)

Hello! I had the same problem and it persists even after enabling port 22 in the firewall.

In my case (I estimate that for having too many ssh keys) I had to initialize the ssh agent and add the key “manually”. And it worked.

The steps I followed were:

To initialize the ssh agent

eval $ (ssh-agent -s)

To add the key

ssh-add -i ~ / .ssh / key

— If your password has a paraphrase, you should insert it — In my case, the key was in the ~ / .ssh / directory and was called “key”, check the names of your files and replace them.

To enter the Droplet via ssh

ssh -i ~ / .ssh / key root @ droplet-ip

— It is important to add the argument “-i” to the ssh command and tell it the full path where your key is located — Then you can indicate with which user and to which IP you will connect

I hope it works for you too.

Regards