Connecting Linux Using Ad Authentication
Connecting Linux Using Ad Authentication
For the purposes of this post, I’m on Red Hat Enterprise 8.3.
1 of 6 8/9/23, 08:40
Connecting a SQL Server client on Linux using Active... https://sqlsunday.com/2021/04/15/connecting-linux-us...
Network setup
Next, make sure that your machine can reach the DNS server of
your Active Directory domain. You may have to reconfigure your
VM to use another, non-public, DNS server. Verify the results by
using nslookup or ping:
$ nslookup my-dc.my-domain.local.
Server: 10.1.2.3
Address: 10.1.2.3#53
Name: my-dc.my-domain.local.
Address: 10.1.2.4
$ ping my-dc.my-domain.local.
You can check that your machine can discover the domain…
2 of 6 8/9/23, 08:40
Connecting a SQL Server client on Linux using Active... https://sqlsunday.com/2021/04/15/connecting-linux-us...
my-domain.local
type: kerberos
realm-name: MY-DOMAIN.LOCAL
domain-name: my-domain.local
configured: no
server-software: active-directory
client-software: sssd
required-package: oddjob
required-package: oddjob-mkhomedir
required-package: sssd
required-package: adcli
required-package: samba-common-tools
At any time, you can verify that you’re joined to a domain using:
MY-DOMAIN.LOCAL
type: kerberos
realm-name: MY-DOMAIN.LOCAL
domain-name: my-domain.local
configured: kerberos-member
server-software: active-directory
client-software: sssd
required-package: oddjob
required-package: oddjob-mkhomedir
required-package: sssd
required-package: adcli
required-package: samba-common-tools
login-formats: %U@my-domain.local
login-policy: allow-realm-logins
If you change your mind, you can leave the domain with:
Configuration
Next up, we’ll be reviewing some config files. I’m a nano type of
guy myself, but any of the popular text editors will do here:
3 of 6 8/9/23, 08:40
Connecting a SQL Server client on Linux using Active... https://sqlsunday.com/2021/04/15/connecting-linux-us...
I found that the default settings in the file work for me, but you
may have to tweak them a little for your machine. This article
(https://www.redhat.com/sysadmin/linux-active-directory) goes
through most of the settings in some detail. If you make any
changes to the config file, remember to restart the service:
$ kinit my.name@MY-DOMAIN.LOCAL
$ klist
And now, you can run sqlcmd to connect to your SQL Server
instance.
4 of 6 8/9/23, 08:40
Connecting a SQL Server client on Linux using Active... https://sqlsunday.com/2021/04/15/connecting-linux-us...
$ sqlcmd -E -S SQL01.my-domain.local.
SayMyName
--------------------------------------
MY-DOMAIN\my.name
(1 rows affected)
Gotchas
More reading
ACTIVE DIRECTORY ,
AUTHENTICATION ,
INTEGRATED AUTHENTICATION ,
KERBEROS ,
LINUX ,
SSSD ,
WINDOWS AUTHENTICATION
2. Steve Kwok
2021-11-22 AT 05:33
Does it work with Windows Server 2008R2?
REPLY
◦ Daniel Hutmacher
2021-11-22 AT 06:47
Have you tried it?
REPLY
6 of 6 8/9/23, 08:40