Has anyone seen the Received disconnect...:11: error immediately after successful publickey authentication when using SQL Server?
-
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.
-
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]
- Steps I've taken to troubleshoot: We have systematically eliminated all infrastructure problems:
-
Bastion Setup Fixed: Initially solved the
Disconnected from invalid user retool [preauth]error by:-
Creating the exact user
retoolon the Windows Server. -
Setting strict permissions on the
C:\Users\retool\.ssh\authorized_keysfile. -
Adding
PubkeyAcceptedKeyTypes +ssh-rsatosshd_configand restarting the service to ensure key compatibility.
-
-
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 1433returnsTcpTestSucceeded : True.
-
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.
-
- Additional info: Retool Environment: Retool Cloud, Bastion OS: Windows Server 2019 running OpenSSH Server, Database: Microsoft SQL Server 2019, Plan: Free