ECONNRESET error experienced when trying to connect Retool Cloud to an on-premises MS SQL database using an SSH tunnel via a Windows Server Bastion host

Has anyone seen the Received disconnect...:11: error immediately after successful publickey authentication when using SQL Server?

  1. My goal: Connect a Resource (MS SQL) to an on-premise database located in a private network, using a Windows Server Bastion host for SSH tunneling.

  2. Issue: The SSH tunnel is successfully authenticating the user, but the connection is immediately closed by the client, resulting in a "No response from server" error in Retool.

    The Windows Bastion logs show the following sequence, indicating the client sends a disconnect immediately after successful authentication:

sshd: Accepted publickey for retool from [RETOOL_IP] port [RANDOM_PORT]

ssh2: RSA SHA256:[KEY_HASH] sshd: Received disconnect from [RETOOL_IP] port [RANDOM_PORT]:11:

sshd: Disconnected from [RETOOL_IP] port [RANDOM_PORT]

  1. Steps I've taken to troubleshoot: We have systematically eliminated all infrastructure problems:
    1. Bastion Setup Fixed: Initially solved the Disconnected from invalid user retool [preauth] error by:

      • Creating the exact user retool on the Windows Server.

      • Setting strict permissions on the C:\Users\retool\.ssh\authorized_keys file.

      • Adding PubkeyAcceptedKeyTypes +ssh-rsa to sshd_config and restarting the service to ensure key compatibility.

    2. Network Verified (Bastion → DB): Successfully tested internal connectivity from the Windows Bastion to the private SQL DB host:

      • Test-NetConnection -ComputerName [DB_PRIVATE_IP] -Port 1433 returns TcpTestSucceeded : True.
    3. DB Authentication Verified: Confirmed the database user/password configured in Retool works by successfully connecting to the private DB IP from the Bastion using SQL Server Management Studio (SSMS) with those exact credentials.

  2. Additional info: Retool Environment: Retool Cloud, Bastion OS: Windows Server 2019 running OpenSSH Server, Database: Microsoft SQL Server 2019, Plan: Free