Skip to content

Trusted connection using pyodbc docker and kerberos not working #262

@lbaudouin

Description

@lbaudouin

I try to connect to Windows hosted SqlServer using Windows Authentication from a docker.

My docker is based on Microsoft/mssql-docker/oss-drivers/pyodbc/

After configuring Kerberos and get a ticket with my Windows account:

I can connect to the realm using my Windows account:

realm join 192.168.1.3 -U '[email protected]' -v

But when I try to execute sql request using isql or pyodbc i have a timeout:

root@WIN-EC79CE70LCL:/etc# isql MSSQLTest -v
[S1T00][unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
[08001][unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2AF9
[08001][unixODBC][Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[ISQL]ERROR: Could not SQLConnect

odbc.ini:

[MSSQLTest]
Driver = ODBC Driver 17 for SQL Server
Server = SERVER.LOCAL,1443
Kerberos = Yes
Trusted_Connection=Yes

odbcinst.ini:

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-17.0.so.1.1
UsageCount=1

Is my config wrong? Do I miss something? Or it is even possible to do what I want to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions