How to Configure SQL Server Windows Authentication in Linux CentOS 7 - SQL Server on Linux Tutorial
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- How to Configure SQL Server Windows Authentication in Linux CentOS 7 video explains all below steps
Create Active Directory Service Account for SQL Server
Setup SPN for SQL Server AG Service Account
Validating Key version Number (kvno)
Create MSSQLScv Keytab
Setting Proper Permission of Keytab
Configure SQL Server Instance to use Keytab file for kerberos Authentication
Restarting SQL server and Testing Using SSMS
Script Used in this Demo:
#Create SQL Server Service Account in Your Active Directory Domain
UserName= mssql
PasswordExpire= never
Setting ServicePrincipalName (SPN) for SQL Server Service account on Your Domain Conroller
setspn -A MSSQLSvc/TBSLinuxNode1.Techbrothers.local:1433 mssql
Checking KVNO (Key Version Number) number for AD Account-usually its 2
kinit mssql@TECHBROTHERS.LOCAL
kvno MSSQLSvc/TBSLinuxNode1.Techbrothers.local:1433
Creating SQL Keytab File (AD Account with password must set this up) using ktutil
sudo ktutil
ktutil: addent -password -p MSSQLSvc/TBSLinuxNode1.Techbrothers.local:1433@TECHBROTHERS.LOCAL -k 3 -e aes256-cts-hmac-sha1-96
ktutil: addent -password -p MSSQLSvc/TBSLinuxNode1.Techbrothers.local:1433@TECHBROTHERS.LOCAL -k 3 -e rc4-hmac
ktutil: wkt /var/opt/mssql/secrets/mssql.keytab
quit
Setting up Proper permission (ownership)
sudo chown mssql:mssql /var/opt/mssql/secrets/mssql.keytab
sudo chmod 400 /var/opt/mssql/secrets/mssql.keytab
Configuring SQL Server to Point to KeyTab File
sudo /opt/mssql/bin/mssql-conf set network.kerberoskeytabfile /var/opt/mssql/secrets/mssql.keytab
Restarting SQL Server Services
sudo systemctl restart mssql-server
Connecting to SSMS and Testing Windows Authentication
Actually, this video is great, show all the needed steps and enough clear, Thank you so much for these useful videos.
Thank you for your videos, it's are very effective and accurate, you are a great work and support for the IT
accurate
This is really good video ,sql linux
Thank you!
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.. in centos 8
This is very good. However, I am running in a slight different issue. I have a SQL running on Windows, I have joined the linux machine to AD, however, when trying to connect to SQL using the credentials of the user logged, it is not working? Do you know how I could configure this? Thanks
Are you trying to access sql server running on windows from Unix box? If so check to see if firewall is the issue - can you share error too please?
@@TechBrothersIT When I ran the command: sqlcmd -E -S sqlserver, I get the following error: Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server: SSPI Provider: Server not found in Kerberos database and Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server: SSPI Provider: Cannot generate SSPI context.
Thanks
@@alwaysilva same error here any solution yet
]