views:

233

answers:

1

So I need to connect to a mssql server via Windows Authentication from a Unix server. Here are the obstacles:

  1. The db admin created a service account but made it Windows-Auth only, meaning I can't pass the username and password directly to the server to connect.

  2. The admin also added my host's server to the firewall so that it would only accept requests from my host machine.

  3. My host server has mssql enabled via freetds/sybase-dblib, but has the default 'secure-connections: Off' still set.

  4. I have a similar set up on my personal machine, but with secure-connections on, but I can't connect that way since I'm firewalled.

So I'm wondering if it's possible to set up a proxy of sorts on my host so that I can start the connection on my personal machine using my local freeTDS library, but have the request pass to the host which would (in my dream world) not require secure connections to be on but simply would pass the request along so that it came from my non-firewalled host but using the correct authentication method.

If anyone is not familiar with how Windows-Authentication works, it's a type of Kerberos authentication where the client machine makes the request to the remote server so that credentials are never actually sent (and thus can't be compromised by a man-in-the-middle). So I'm very doubtful that this can be done, since at some level my host machine has to do the actual work. But i thought I'd ask since I'm not totally clear on the deeper mechanics and because I really want to get this to happen.

I guess another way of looking at it is I want to use my host as a kind of VPN.

Also, I am working with my host admins to find a more long-term solution but I need to see the database as soon as possible so I can have something working when the problem gets fixed.

A: 

Why don't you try SSH port forwarding? Ie. you connect to your host server, and tell it to forward a local port to the sql server. Then you connect on your local machine using localhost:port and your connection will be tunneled over ssh through your host server.

If your local machine is a Windows machine then just download PuTTY and follow these instructions to set up port forwarding : http://www.cs.uu.nl/technical/services/ssh/putty/puttyfw.html.

The question is of course whether your Windows credentials will be passed, but in theory this should work :p.

wimvds
I actually realized that I had the option to VPN to the same primary domain (which means I wouldn't be on the same sub-domain as my host but would be on main domain), and was able to establish the initial connection and see the login packet sent by freeTDS. Even on the VPN it showed my hostname as my local host. After many variations and attempts, the remote server started killing the successful connection before the request packet was even sent, so I'm too nervous to spoof it. Your idea should work but I'm guessing would produce the same results. Thanks for the idea though.
Anthony