Report this

What is the reason for this report?

Timed out while waiting for handshake when using SSH2 (App platform)

Posted on August 26, 2025

I have my backend application (App platform) and droplet with which I want to connect via ssh2 from my backend app. In development it works fine, but in production I have an error:

[2025-08-26 12:10:21] Custom crypto binding available
 [2025-08-26 12:10:21] Local ident: 'SSH-2.0-ssh2js1.16.0'
[2025-08-26 12:10:21] Client: Trying 134.209.... on port 22 ...
[2025-08-26 12:10:41] [Nest] 17  - 08/26/2025, 12:10:41 PM   ERROR [ExceptionsHandler] Error: Error loading and parsing properties file: Timed out while waiting for handshake
[2025-08-26 12:10:41]     at BBBServerService.getConfig (/workspace/dist/src/modules/bbb/bbb-server.service.js:126:19)
 [2025-08-26 12:10:41]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 [2025-08-26 12:10:41]     at async BBBController.getConfig (/workspace/dist/src/modules/bbb/bbb.controller.js:52:28)
 [2025-08-26 12:10:41] Socket closed

Any ideas how to fix this? I guess the problem is with my backend application? Some rules forbid this operation? What is the simplest way to fix that?



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.

Hey Jaroslaw,

If I remember correctly on the App Platform, outbound connections to port 22 are blocked, which is why your SSH handshake is timing out.

One workaround is to configure your Droplet’s SSH service to listen on a different port (for example 2222).

Then update your firewall rules to allow access on that port, and point your backend app to connect there instead.

This not only bypasses the App Platform restriction but is also considered a bit more secure than leaving SSH exposed on the default port.

DigitalOcean has a guide on how to do that as well: https://docs.digitalocean.com/support/how-do-i-change-my-droplets-ssh-port/

This error usually means your SSH client can’t establish a connection to the server — it’s often caused by one of the following:

  1. Firewall or Network Issues
  • The port (usually 22) might be blocked by a firewall or not open on the server.

  • Check that the server is reachable and the port is open.

  • Use telnet your.server.ip 22 or nc -zv your.server.ip 22 to test.

  1. SSH Daemon Not Running
  • The server might not have the SSH service (sshd) running.

  • If you have other access (e.g., console), check and start the service manually.

  1. Wrong Host/IP or DNS Issue
  • Double-check the hostname or IP you’re connecting to.

  • Ensure DNS is resolving correctly if using a domain.

  1. Incorrect SSH Configuration
  • Make sure you’re using the correct authentication method, port, and protocol version.

  • If you’re using an app platform (like a PaaS), verify that SSH access is enabled and configured correctly in the platform settings.

  1. Cloud/Platform-Specific Restrictions
  • Some app platforms restrict SSH access or require specific keys or settings.

  • Check your app platform’s documentation for SSH access setup.

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.