此内容没有您所选择的语言版本。
13.2.14. Configuring Domains: Active Directory as an LDAP Provider (Alternative)
While Active Directory can be configured as a type-specific identity provider, it can also be configured as a pure LDAP provider with a Kerberos authentication provider.
Procedure 13.7. Configuring Active Directory as an LDAP Provider
- It is recommended that SSSD connect to the Active Directory server using SASL, which means that the local host must have a service keytab for the Windows domain on the Linux host.This keytab can be created using Samba.
- Configure the
/etc/krb5.conf
file to use the Active Directory realm.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Samba configuration file,
/etc/samba/smb.conf
, to point to the Windows Kerberos realm.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To initialize Kerberos, type the following command as
root
:kinit Administrator@EXAMPLE.COM
~]# kinit Administrator@EXAMPLE.COM
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Then, run the
net ads
command to log in as an administrator principal. This administrator account must have sufficient rights to add a machine to the Windows domain, but it does not require domain administrator privileges.net ads join -U Administrator
~]# net ads join -U Administrator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run
net ads
again to add the host machine to the domain. This can be done with the host principal (host/FQDN) or, optionally, with the NFS service (nfs/FQDN).net ads join createupn="host/rhel-server.example.com@AD.EXAMPLE.COM" -U Administrator
~]# net ads join createupn="host/rhel-server.example.com@AD.EXAMPLE.COM" -U Administrator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Make sure that the Services for Unix package is installed on the Windows server.
- Set up the Windows domain which will be used with SSSD.
- On the Windows machine, open Server Manager.
- Create the Active Directory Domain Services role.
- Create a new domain, such as
ad.example.com
. - Add the Identity Management for UNIX service to the Active Directory Domain Services role. Use the Unix NIS domain as the domain name in the configuration.
- On the Active Directory server, create a group for the Linux users.
- Open Administrative Tools and select Active Directory Users and Computers.
- Select the Active Directory domain,
ad.example.com
. - In the Users tab, right-click and select .
- Name the new group
unixusers
, and save. - Double-click the
unixusers
group entry, and open the Users tab. - Open the Unix Attributes tab.
- Set the NIS domain to the NIS domain that was configured for
ad.example.com
and, optionally, set a group ID (GID) number.
- Configure a user to be part of the Unix group.
- Open Administrative Tools and select Active Directory Users and Computers.
- Select the Active Directory domain,
ad.example.com
. - In the Users tab, right-click and select .
- Name the new user
aduser
, and make sure that the User must change password at next logon and Lock account check boxes are not selected.Then save the user. - Double-click the
aduser
user entry, and open the Unix Attributes tab. Make sure that the Unix configuration matches that of the Active Directory domain and theunixgroup
group:- The NIS domain, as created for the Active Directory domain
- The UID
- The login shell, to
/bin/bash
- The home directory, to
/home/aduser
- The primary group name, to
unixusers
Note
Password lookups on large directories can take several seconds per request. The initial user lookup is a call to the LDAP server. Unindexed searches are much more resource-intensive, and therefore take longer, than indexed searches because the server checks every entry in the directory for a match. To speed up user lookups, index the attributes that are searched for by SSSD:- uid
- uidNumber
- gidNumber
- gecos
- On the Linux system, configure the SSSD domain.
vim /etc/sssd/sssd.conf
~]# vim /etc/sssd/sssd.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a complete list of LDAP provider parameters, see thesssd-ldap(5)
man pages.Example 13.9. An Active Directory 2008 R2 Domain with Services for Unix
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart SSSD.
service sssd restart
~]# service sssd restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow