7

I'm using WSL in an exclusively windows environment because of a number of tools that are only really available for Linux. I often connect to DBs programmatically and would like to be able to do that without specifying my login information. For example in Python through Windows I could do this:

import pymssql

con = pymssql.connect(server, port)

And that connection would go through without my having to specify any credentials because my AD account has access to the server, and pymssql will use windows auth when no credentials are specified.

In python running on WSL however that doesn't work, and so to make the same connection I would have to additionally pass the user and password parameters.

Is there any way to make WSL inherit windows authentication when running Linux processes?

Dan Scally
  • 1,922
  • 1
  • 19
  • 31
  • https://stackoverflow.com/questions/51736743/how-do-i-enable-active-directory-ldap-kerberos-in-windows-subsystem-for-linux-w The comments at this link provide some context, but no solutions. – yzorg Oct 03 '19 at 16:56
  • Just linking essentially the same question: https://serverfault.com/questions/1033953/how-to-use-windows-kerberos-ticket-in-wsl-and-or-docker – SerG Mar 22 '21 at 15:39
  • This is a bad question. If the Windows Credential Manager isn't the solution you are looking for please rephrase. You stated that you didn't want your code passing plain text. Windows Credential Manager Meets all of those needs. Either Windows Credential Manager is your solution, some other third party Password Vault, or you need to rethink how you are accessing the Database. – Technoob1984 May 18 '22 at 16:18

0 Answers0