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/linux/sql-server-linux-active-directory-authentication.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,9 @@ For more information, see the Red Hat documentation for [Discovering and Joining
200
200
kvno MSSQLSvc/**<fully qualified domain name of host machine>**:**<tcp port>**
201
201
```
202
202
203
+
> [!NOTE]
204
+
> SPNs can take several minutes to propagate through your domain, especially if the domain is large. If you receive the error, "kvno: Server not found in Kerberos database while getting credentials for MSSQLSvc/\*\*\<fully qualified domain name of host machine\>\*\*:\*\*\<tcp port\>\*\*\@CONTOSO.COM", please wait a few minutes and try again.
205
+
203
206
2. Create a keytab file with **[ktutil](https://web.mit.edu/kerberos/krb5-1.12/doc/admin/admin_commands/ktutil.html)** for the AD user you created in the previous step. When prompted, enter the password for that AD account.
204
207
205
208
```bash
@@ -217,20 +220,56 @@ For more information, see the Red Hat documentation for [Discovering and Joining
217
220
> [!NOTE]
218
221
> The ktutil tool does not validate the password, so make sure you enter it correctly.
219
222
220
-
3. Anyone with access to this `keytab` file can impersonate [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] on the domain, so make sure you restrict access to the file such that only the `mssql` account has read access:
223
+
3. Add the machine account to your keytab with **[ktutil](https://web.mit.edu/kerberos/krb5-1.12/doc/admin/admin_commands/ktutil.html)**. The machine account (also called a UPN) is present in `/etc/krb5.keytab` in the form "\<hostname\>$\@\<realm.com\>" (e.g. sqlhost$\@CONTOSO.COM). We will copy these entries from `/etc/krb5.keytab` to `mssql.keytab`.
224
+
225
+
```bash
226
+
sudo ktutil
227
+
228
+
# Read all entries from /etc/krb5.keytab
229
+
ktutil: rkt /etc/krb5.keytab
230
+
231
+
# List all entries
232
+
ktutil: list
233
+
234
+
# Delete all entries by their slot number which are not the UPN one at a
235
+
# time.
236
+
# Warning: when an entry is deleted (e.g. slot 1), all values slide up by
237
+
# one to take its place (e.g. the entry in slot 2 moves to slot 1 when slot
238
+
# 1's entry is deleted)
239
+
ktutil: delent <slot num>
240
+
ktutil: delent <slot num>
241
+
...
242
+
243
+
# List all entries to ensure only UPN entries are left
244
+
ktutil: list
245
+
246
+
# When only UPN entries are left, append these values to mssql.keytab
247
+
ktutil: wkt /var/opt/mssql/secrets/mssql.keytab
248
+
249
+
quit
250
+
```
251
+
252
+
4. Anyone with access to this `keytab` file can impersonate [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] on the domain, so make sure you restrict access to the file such that only the `mssql` account has read access:
4. Configure [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] to use this `keytab` file for Kerberos authentication:
259
+
5. Configure [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] to use this `keytab` file for Kerberos authentication:
228
260
229
261
```bash
230
262
sudo /opt/mssql/bin/mssql-conf set network.kerberoskeytabfile /var/opt/mssql/secrets/mssql.keytab
231
263
sudo systemctl restart mssql-server
232
264
```
233
265
266
+
6. Optional: Disable UDP connections to the domain controller to improve performance. In many cases, UDP connections will always fail when connecting to a domain controller, so you can set config options in `/etc/krb5.conf` to skip UDP calls. Edit `/etc/krb5.conf` and set the following options:
267
+
268
+
```/etc/krb5.conf
269
+
[libdefaults]
270
+
udp_preference_limit=0
271
+
```
272
+
234
273
## <aid="createsqllogins"></a> Create AD-based logins in Transact-SQL
235
274
236
275
1. Connect to [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)] and create a new, AD-based login:
@@ -274,7 +313,7 @@ The specific connection string parameter for clients to use AD Authentication de
274
313
* JDBC: [Using Kerberos Integrated Authentication to Connect SQL Server](https://docs.microsoft.com/sql/connect/jdbc/using-kerberos-integrated-authentication-to-connect-to-sql-server)
Always backup your database master key. For more information on database master keys, see [CREATE MASTER KEY (Transact-SQL)](../../../t-sql/statements/create-master-key-transact-sql.md).
60
60
61
-
#### To encrypt a column of data using a simple symmetric encryption
61
+
#### To encrypt a column of data using symmetric encryption that includes an authenticator
62
62
63
63
1. In **Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../../includes/ssde-md.md)].
64
64
@@ -117,7 +117,7 @@ Always backup your database master key. For more information on database master
117
117
GO
118
118
```
119
119
120
-
#### To encrypt a column of data using symmetric encryption that includes an authenticator
120
+
#### To encrypt a column of data using a simple symmetric encryption
121
121
122
122
1. In **Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../../includes/ssde-md.md)].
> Test your DDL triggers to determine their responses to system stored procedures that are run. For example, the CREATE TYPE statement and the **sp_addtype** stored procedure will both fire a DDL trigger that is created on a CREATE_TYPE event.
33
33
34
34
## Types of DDL Triggers
35
-
Transact-SQL DDL Trigger
35
+
### Transact-SQL DDL Trigger
36
36
A special type of [!INCLUDE[tsql](../../includes/tsql-md.md)] stored procedure that executes one more more [!INCLUDE[tsql](../../includes/tsql-md.md)] statements in response to a server-scoped or database-scoped event. For example, a DDL Trigger may fire if a statement such as ALTER SERVER CONFIGURATION is executed or if a table is deleted by using DROP TABLE.
37
37
38
-
CLR DDL Trigger
38
+
### CLR DDL Trigger
39
39
Instead of executing a [!INCLUDE[tsql](../../includes/tsql-md.md)] stored procedure, a CLR trigger executes one or more methods written in managed code that are members of an assembly created in the .NET Framework and uploaded in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
40
40
41
41
DDL triggers fire only after the DDL statements that trigger them are run. DDL triggers cannot be used as INSTEAD OF triggers. DDL triggers do not fire in response to events that affect local or global temporary tables and stored procedures.
Copy file name to clipboardExpand all lines: docs/t-sql/statements/set-implicit-transactions-transact-sql.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ SET IMPLICIT_TRANSACTIONS { ON | OFF }
55
55
56
56
When OFF, each of the preceding T-SQL statements is bounded by an unseen BEGIN TRANSACTION and an unseen COMMIT TRANSACTION statement. When OFF, we say the transaction mode is *autocommit*. If your T-SQL code visibly issues a BEGIN TRANSACTION, we say the transaction mode is *explicit*.
57
57
58
-
There are several clarifying point to understand:
58
+
There are several clarifying points to understand:
59
59
60
60
- When the transaction mode is implicit, no unseen BEGIN TRANSACTION is issued if @@trancount > 0 already. However, any explicit BEGIN TRANSACTION statements still increment @@TRANCOUNT.
0 commit comments