You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/azure-data-studio/enable-kerberos.md
+58-31Lines changed: 58 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,11 @@ title: Connect your SQL Server instance using Windows authentication (Kerberos)
3
3
description: Learn how to connect Azure Data Studio to your SQL Server instance by using Microsoft Kerberos integrated authentication.
4
4
author: markingmyname
5
5
ms.author: maghan
6
-
ms.reviewer: alayu
7
-
ms.date: 05/03/2021
6
+
ms.reviewer: alayu, randolphwest
7
+
ms.date: 06/15/2023
8
8
ms.service: azure-data-studio
9
9
ms.topic: how-to
10
10
---
11
-
12
11
# Connect Azure Data Studio to SQL Server using Kerberos
13
12
14
13
Azure Data Studio supports connecting to SQL Server by using Kerberos.
@@ -20,41 +19,47 @@ To use integrated authentication (Windows Authentication) on macOS or Linux, you
20
19
To get started, you need:
21
20
22
21
- Access to a Windows domain-joined machine to query your Kerberos domain controller.
22
+
23
23
- SQL Server should be configured to allow Kerberos authentication. For the client driver running on Unix, integrated authentication is supported only by using Kerberos. For more information, see [Using Kerberos integrated authentication to connect to SQL Server](../connect/jdbc/using-kerberos-integrated-authentication-to-connect-to-sql-server.md). There should be [service principal names (SPNs)](/windows/win32/ad/service-principal-names) registered for each instance of SQL Server you're trying to connect to. For more information, see [Register a Service Principal Name for Kerberos Connections](../database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections.md).
24
24
25
25
## Check if SQL Server has a Kerberos setup
26
26
27
-
Sign in to the host machine of SQL Server. From the Windows command prompt, use `setspn -L %COMPUTERNAME%` to list all the SPNs for the host. Verify there are entries that begin with MSSQLSvc/HostName.Domain.com. These entries mean that SQL Server has registered an SPN and is ready to accept Kerberos authentication.
27
+
Sign in to the host machine of SQL Server. From the Windows command prompt, use `setspn -L %COMPUTERNAME%` to list all the SPNs for the host. Verify there are entries that begin with `MSSQLSvc/HostName.contoso.com`. These entries mean that SQL Server has registered an SPN and is ready to accept Kerberos authentication.
28
28
29
29
If you don't have access to the host of the SQL Server instance, then from any other Windows OS joined to the same Active Directory, you could use the command `setspn -L <SQLSERVER_NETBIOS>`, where *<SQLSERVER_NETBIOS>* is the computer name of the host of the SQL Server instance.
30
30
31
31
## Get the Kerberos Key Distribution Center
32
32
33
33
Find the Kerberos Key Distribution Center (KDC) configuration value. Run the following command on a Windows computer that's joined to your Active Directory domain.
34
34
35
-
Start `cmd.exe`and run `nltest`.
35
+
Run `nltest` from the command line, and replace "DOMAIN.CONTOSO.COM" with your domain's name.
36
36
37
+
```console
38
+
nltest /dsgetdc:DOMAIN.CONTOSO.COM
37
39
```
38
-
nltest /dsgetdc:DOMAIN.COMPANY.COM (where "DOMAIN.COMPANY.COM" maps to your domain's name)
39
40
40
-
Sample Output
41
-
DC: \\dc-33.domain.company.com
41
+
Output is similar to the following sample:
42
+
43
+
```output
44
+
DC: \\dc-33.domain.contoso.com
42
45
Address: \\2111:4444:2111:33:1111:ecff:ffff:3333
43
46
...
44
47
The command completed successfully
45
48
```
46
-
Copy the DC name that's the required KDC configuration value. In this case, it's dc-33.domain.company.com.
49
+
50
+
Copy the DC name that's the required KDC configuration value. In this case, it's dc-33.domain.contoso.com.
47
51
48
52
## Join your OS to the Active Directory domain controller
Edit the `/etc/network/interfaces` file so that your Active Directory domain controller's IP address is listed as dns-nameserver. For example:
60
+
Edit the `/etc/network/interfaces` file so that your Active Directory domain controller's IP address is listed as `dns-nameserver`. For example:
56
61
57
-
```/etc/network/interfaces
62
+
```output
58
63
<...>
59
64
# The primary network interface
60
65
auto eth0
@@ -63,7 +68,7 @@ dns-nameservers **<AD domain controller IP address>**
63
68
dns-search **<AD domain name>**
64
69
```
65
70
66
-
> [!NOTE]
71
+
> [!NOTE]
67
72
> The network interface (eth0) might differ for different machines. To find out which one you're using, run ifconfig and copy the interface that has an IP address and transmitted and received bytes.
68
73
69
74
After editing this file, restart the network service:
Edit the `/etc/sysconfig/network-scripts/ifcfg-eth0` file (or other interface config file as appropriate) so that your Active Directory domain controller's IP address is listed as a DNS server:
94
106
95
-
```/etc/sysconfig/network-scripts/ifcfg-eth0
107
+
```output
96
108
<...>
97
109
PEERDNS=no
98
110
DNS1=**<AD domain controller IP address>**
@@ -104,64 +116,79 @@ After editing this file, restart the network service:
104
116
sudo systemctl restart network
105
117
```
106
118
107
-
Now check that your `/etc/resolv.conf` file contains a line like the following one:
119
+
Now check that your `/etc/resolv.conf` file contains a line like the following one:
0 commit comments