19.14. Using PAM for Pass-Through Authentication

Figure 19.3. PAM Pass-Through Authentication Process
Note
19.14.1. PAM Pass-Through Authentication Configuration Options
- The suffixes that are controlled by the PAM pass-through authentication plug-in. This covers suffixes to exclude, suffixes to include, and how to handle a missing suffix.
- Individual entries within the configured suffixes which are the target of the authentication configuration. By default, all entries within a suffix are included in the authentication scope, but it is possible to configure multiple, different PAM Pass-Through Auth plug-in instances and then apply different plug-in configuration to different users.
- The PAM attribute mapping. The credentials that are offered to the Directory Server have to be mapped in some way to an LDAP entry and then, back to the credentials in the PAM service. This is done by defining a mapping method and then, optionally, which LDAP attribute to use to match the credentials.
- General configuration such as using TLS connections, the PAM service to use, and whether to fallback to LDAP authentication if PAM authentication fails.
Note
pamFilter attribute to set an LDAP filter to search for the specific entries to use with the plug-in.
19.14.1.1. Specifying the Suffixes to Target for PAM PTA
Note
cn=config which is associated with NetscapeRoot or the root suffix dc=example,dc=com which is associated with userRoot.
pamExcludeSuffix attribute excludes a suffix. By default, only the configuration subtree (cn=config) is excluded. Alternatively, the PAM PTA plug-in can be applied to a suffix with the pamIncludeSuffix attribute. Both of these attributes are multi-valued.
pamExcludeSuffix: cn=config pamExcludeSuffix: o=NetscapeRoot
pamIncludeSuffix, only the given suffix is included and all others are automatically excluded. Since this attribute is multi-valued, more than one suffix can be included in the PAM evaluation by explicitly listing the suffixes.
pamIncludeSuffix: ou=Engineering,dc=example,dc=com pamIncludeSuffix: ou=QE,dc=example,dc=com
pamMissingSuffix attribute tells the server how to handle a failure if the specified suffix (include or exclude) does not exist. If it is set to IGNORE, then if the suffix does not exist, the plug-in simply skips that suffix and tries the next.
pamMissingSuffix: IGNORE pamIncludeSuffix: ou=Engineering,dc=example,dc=com pamIncludeSuffix: ou=Not Real,dc=example,dc=com
19.14.1.2. Applying Different PAM Pass-Through Authentication Configurations to Different Entries
pamFilter attribute which identifies specific entries within the suffix to which to apply the PAM pass-through authentication policy.
19.14.1.3. Setting PAM PTA Mappings
pamIDMapMethod: RDN ENTRY DN
Note
Table 19.6. Mapping Methods for PAM Authentication
| Mapping | Description |
|---|---|
| RDN | This method uses the value from the leftmost RDN in the bind DN. The mapping for this method is defined by Directory Server. This is the default mapping method, if none is given. |
| ENTRY | This method pulls the value of the PAM identity from a user-defined attribute in the bind DN entry. The identity attribute is defined in the pamIDAttr attribute. For example: pamIDAttr: customPamUid |
| DN | This method uses the full distinguished name from the bind DN. The mapping for this method is defined by Directory Server. |
19.14.1.4. Configuring General PAM PTA Settings
- The service name to send to PAM (
pamService); this is the name of the configuration file to use in/etc/pam.d - Whether to require a secure connection (
pamSecure) - Whether to fall back to LDAP authentication if PAM authentication fails (
pamFallback)
pamFallback: false pamSecure: false pamService: ldapserver
19.14.2. Configuring PAM Pass-Through Authentication
Note
pamFilter attribute to set an LDAP filter to search for the specific entries to use with the plug-in.
- Make sure the PAM service is fully configured.
- Remove the
pam_fprintd.somodule from the PAM configuration file.Important
Thepam_fprintd.somodule cannot be in the configuration file referenced by thepamServiceattribute of the PAM Pass-Through Authentication Plug-in configuration. Using the PAMfprintdmodule causes the Directory Server to hit the max file descriptor limit and can cause the Directory Server process to abort. - Enable the plug-in; this is disabled by default.
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=PAM Pass-Through Auth Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
- Create the PAM Pass-Through Auth plug-in configuration entry.
# ldapmodify
-a-D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=Admin PAM PTA Config,cn=PAM Pass-Through Auth Plugin,cn=plugins,cn=config cn: AD PAM PTA Config - Add the attributes available for the PAM plug-in. The available attributes are listed in Section 19.14.1, “PAM Pass-Through Authentication Configuration Options”, and Example 19.2, “Example PAM Pass-Through Authentication Configuration Entry” has an example entry.
- Restart the server to load the new plug-in configuration.
# systemctl restart dirsrv.target
Example 19.2. Example PAM Pass-Through Authentication Configuration Entry
dn: cn=Admin PAM PTA Config,cn=PAM Pass Through Auth,cn=plugins,cn=config objectclass: top objectclass: pamConfig objectClass: nsSlapdPlugin objectClass: extensibleObject cn: Admin PAM PTA Config pamMissingSuffix: ALLOWpamExcludeSuffix: cn=configpamExcludeSuffix: o=NetscapeRootpamIDMapMethod: RDN ENTRYpamIDAttr: customPamUidpamFilter: (manager=uid=bjensen,ou=people,dc=example,dc=com)pamFallback: FALSEpamSecure: TRUEpamService: ldapserver
19.14.3. Using PAM Pass-Through Authentication with Active Directory as the Backend

Figure 19.4. PAM Pass-Through Authentication with SSSD
- Configure SSSD to use the Active Directory server as one of its identity providers.This configuration is covered in the Red Hat Enterprise Linux 6 Deployment Guide.
- Enable the PAM Pass-Through Auth plug-in; this is disabled by default.
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=PAM Pass-Through Auth Plugin,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on
- Create the PAM Pass-Through Auth plug-in configuration entry.
# ldapmodify
-a-D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=AD PAM PTA Config,cn=PAM Pass-Through Auth Plugin,cn=plugins,cn=config cn: AD PAM PTA Config - Set the
pamServiceattribute to point to the PAM configuration file managed by SSSD. By default, this is/etc/pam.d/system-auth.pamService: system-auth
Important
Thepam_fprintd.somodule cannot be in the configuration file referenced by thepamServiceattribute of the PAM Pass-Through Authentication Plug-in configuration. Using the PAMfprintdmodule causes the Directory Server to hit the max file descriptor limit and can cause the Directory Server process to abort. - Configure the ID map method and attribute. There are several options for how this can be done, depending on the Directory Server environment.The simplest is to use the RDN map method, which automatically uses the
uidattribute (or the correct naming attribute) to map Directory Server users back to Active Directory users (since Active Directory is the identity provider).pamIDMapMethod: RDN
Similarly, this can be accomplished with the ENTRY map method by using thesamAccountNameattribute. If the user accounts in Directory Server are created withuids that match thesamAccountNamevalue for the user account in Active Directory, then the mapping is successful.pamIDMapMethod: ENTRY pamIDAttr: samAccountName
If Windows synchronization is configured, then the ENTRY method can be used with thentUserDomainIdattribute. The Directory Server and Active Directory user accounts are already synced, based on that attribute value, so the PAM mapping is successful.pamIDMapMethod: ENTRY pamIDAttr: ntUserDomainId
- Restart the server to load the plug-in configuration.
# systemctl restart dirsrv.target

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.