Report this

What is the reason for this report?

Suddenly I can't enter in server with ssh in terminal, I am getting Connection timed out. How can I solve this?

Posted on April 7, 2024

ssh root@2**.1**.1**.1** ssh: connect to host 2**.1**.1**.1** port 22: Connection timed out



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.

Hi there,

Have you tried accessing the server via the web console?

https://docs.digitalocean.com/products/droplets/how-to/connect-with-console/

If the server has a firewall enabled, it must be configured to allow SSH connections. You can check this by accessing the server’s firewall settings and ensuring that inbound connections on port 22 are allowed.

If you don’t have a firewall and the web console also does not work, you can try rebooting the server and also using the recovery console:

https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/

Let me know how it goes!

Best,

Bobby

Heya @biprajitkarmakar,

Make sure your Droplet is running, try to ping your Droplet’s IP address. If it doesn’t time out then you can use the DigitalOcean Recovery or Web Console to enter:

Web Console: https://docs.digitalocean.com/products/droplets/how-to/connect-with-console/

Recovery Console: https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/

Once inside you should be able to troubleshoot further. One reasone could be that you don’t have enough space on your Droplet or your firewall is blocking port 22.

IF your droplet doesn’t ping, try to reboot it and see if that helps. If it doesn’t it’s best to contact DigitalOcean’s support

https://www.digitalocean.com/support/

Hope that helps! - KFSys.

Hello, @biprajitkarmakar

Experiencing a “Connection timed out” error when trying to SSH into your server can be due to various reasons, such as network issues, incorrect SSH command syntax, server configuration, or firewall settings. Here are some steps you can take to troubleshoot and resolve the issue:

  • Check Network Connection: Ensure that your local machine has a stable internet connection and can reach the server’s IP address.
  • Verify Server Status: Make sure that the server is up and running. If possible, check the server’s status from a different network or machine.
  • Confirm SSH Service: Ensure that the SSH service is running on the server and listening on the correct port (default is 22).
  • Check Firewall Settings: Verify that your firewall and the server’s firewall are configured to allow SSH traffic on port 22.
  • Use Verbose Mode: Run the SSH command with the -vvv option to get more detailed output, which can help identify where the connection is failing.
  • Increase Timeout: You can increase the timeout value in your SSH client settings to see if it resolves the issue.
  • Check SSH Configuration: Ensure that the SSH configuration on the server is correct and hasn’t been changed recently.

Here’s an example of using the verbose mode to get more information:

ssh -vvv root@2**.1**.1**.1**

I hope my suggestion is helpful for 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.