2

An owner of a MS SQL db has allowed access to their db from an IP address of a remote machine I own. I can SSH into that machine and connect to the DB using:

ssh -i my.pem 100.0.0.100

sqlcmd -S xxxxx.database.windows.net -d MYDBNAME -U MYUSERNAME

Now I want to use a frontend GUI and connect to that database from my local machine. Is this possible? Do I need to install something on my remote machine?

(I tried using SSH Tunnel with DBeaver but get error "The TCP/IP connection to the host 127.0.0.1, port 11232 has failed. Error: "The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port." I'm not sure if "host" means my remote machine or the database host.)

  • 3
    The problem with this combination is that MSSQL by default does not bind to a default port for the database connections. Instead, it uses a second port to resolve the name of the database to it's current random port, which makes it difficult to forward the correct port when you start SSH. You would need to configure your MSSQL server to bind to a static port instead of the default dynamic port. – Gerald Schneider Nov 27 '18 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.