Go to main content

Working With Oracle® Solaris 11.3 Directory and Naming Services: LDAP

Exit Print View

Updated: September 2018

Pluggable Authentication Methods

With the Pluggable Authentication Method (PAM) framework, you can choose among several authentication services, including the pam_unix_*, pam_krb5, and pam_ldap_* modules.

To use per-user authentication, you must enable pam_krb5. You can also use pam_krb5 authentication if you do not assign the per-user credential level. If proxy or anonymous credential levels are used to access directory server data, then you cannot restrict access to directory data on a per-user basis.

If you choose anonymous or proxy authentication, use the pam_ldap module instead of the equivalent pam_unix_* modules. The pam_ldap module is more flexible, supports stronger authentication methods, and can perform account management.

The following table summarizes the differences between authentication mechanisms.

Table 3  Authentication Behavior of PAM Modules
Password Sent
Uses passwd service authentication method
Uses passwd service authentication method
Uses Kerberos single sign-on technology.
New Password Sent
No encryption (unless TLS is used)
Uses Kerberos. Passwords are not sent over the wire.
New Password Stored
crypt format
Password storage scheme defined on ODSEE
Uses Kerberos to manage passwords.
Requires password read?
sasl/digest-MD5 compatibility after changing password
No. Password is not stored unencrypted. User cannot authenticate.
Yes. User can authenticate if the default storage scheme is set to clear.
No. Uses sasl/GSSAPI. There are no passwords over the wire and there are no passwords to be stored in the directory server except when using a Kerberos kdc that manages its password database in the LDAP directory server.
Password policy supported?
Yes. enableShadowUpdate must be set to true.
Yes, if configured.
See the pam_krb5(5) man page and Kerberos V5 Account Management Module.

LDAP Service Module

When running with Oracle Directory Server Enterprise Edition (ODSEE) or with Microsoft Active Directory (AD), the pam_ldap module enables passwordless authentication: Users can log in with commands such as ssh and sftp without giving a password.

For information about account management, see Enabling Account Management for Clients That Use the pam_ldap Module.

Configuring Oracle Directory Server Enterprise Edition for Passwordless Public Key Authentication

The control on the directory server is enabled by default. This control only applies to ODSEE. To modify the default control configuration, add ACIs on the directory server as shown in the following example:

dn: oid=,cn=features,cn=config
objectClass: top
objectClass: directoryServerFeature
cn:Password Policy Account Usable Request Control
aci: (targetattr != "aci")(version 3.0; acl "Account Usable";
allow (read, search, compare, proxy)
(groupdn = "ldap:///cn=Administrators,cn=config");)
creatorsName: cn=server,cn=plugins,cn=config
modifiersName: cn=server,cn=plugins,cn=config

The pam_ldap module does not read the userPassword attribute. If no client uses UNIX authentication, granting read access to the userPassword attribute is unnecessary. Similarly, the pam_ldap module does not support none as an authentication method.

Note -  If the simple authentication method is used, the userPassword attribute can be read unencrypted by third parties.

The serviceAuthenticationMethod attribute, if defined, determines the manner in which the user binds to the LDAP server. Otherwise, the authenticationMethod attribute is used. After the pam_ldap module successfully binds to the server with the user’s identity and password, the module authenticates the user. You can perform account management and retrieve the account status of users while the user is logging in without authenticating to the directory server.

Configuring Microsoft Active Directory Server for Passwordless Public Key Authentication

The pam_ldap module can also retrieve the account status of users from an AD server to allow passwordless public key authentication for commands such as ssh and sftp. AD must delegate ReaduserAccountControl permission to the security group to which the LDAP client’s proxy user belongs. The pam_ldap module uses the proxy user to retrieve account status information. For each user, the user account control attributes to be read are: userAccountControl, msDS-User-Account-Control-Computed, msDS-UserPasswordExpiryTimeComputed, accountExpires, and pwdLastSet. Consult the Microsoft Active Directory Server documentation for how to delegate the ReaduserAccountControl permission.

pam_unix_* Service Modules

If the /etc/pam.conf file is unconfigured, UNIX authentication is enabled by default.

Note -  The pam_unix module has been removed and is no longer supported in Oracle Solaris. The module has been replaced by a different set of service modules that provides equivalent or greater functionality. In this guide, pam_unix refers to the modules that provide equivalent functionality, not to the pam_unix module itself.

The following modules provide the equivalent functionality as the original pam_unix module. The modules are listed by using their corresponding man pages.

The pam_unix_* modules use the following UNIX authentication model:

  1. The client retrieves the user’s encrypted password from the name service.

  2. The user is prompted for the password.

  3. The user’s password is encrypted.

  4. The client compares the two encrypted passwords to determine whether the user should be authenticated.

The pam_unix_* modules have the following restrictions:

  • The password must be stored in UNIX crypt format.

  • The userPassword attribute must be readable by the name service.

    For example, if you set the credential level to anonymous, then anyone must be able to read the userPassword attribute. Similarly, if you set the credential level to proxy, then the proxy user must be able to read the userPassword attribute.

Note -  UNIX authentication is incompatible with the sasl/digest-MD5 authentication method. In ODSEE, passwords must be stored unencrypted to use digest-MD5.

The pam_unix_account module supports account management when the enableShadowUpdate switch is set to true. The controls for a remote LDAP user account are applied in the same manner that controls are applied to a local user account that is defined in the passwd and shadow files. For the LDAP account in enableShadowUpdate mode, the system updates and uses the shadow data on the LDAP server for password aging and account locking. The shadow data of the local account only applies to the local client system, while the shadow data of an LDAP user account applies to the user on all client systems.

You can check the password history only for the local client and not for an LDAP user account.

Kerberos Service Module

For information about Kerberos, see Managing Kerberos and Other Authentication Services in Oracle Solaris 11.3 and the pam_krb5(5) man page.

Changing Passwords That Use PAM

Use the passwd command to change a password. If the enableShadowUpdate switch is not enabled, the userPassword attribute must be writable by the user as well as by the administrator credentials. The serviceAuthenticationMethod for passwd-cmd overrides the authenticationMethod for this operation. Depending on the authentication method, the current password might be unencrypted.

In UNIX authentication, the new userPassword attribute is encrypted with the UNIX crypt format. The attribute is tagged before being written to LDAP. Thus, the new password is encrypted regardless of the authentication method used to bind to the server. For more information, see the pam_authtok_store(5) man page.

If the enableShadowUpdate switch is enabled, the pam_unix_* modules update the related shadow information when the user password is changed. Similarly, the pam_unix_* modules update the shadow fields in the local shadow files that the modules update when the local user password is changed.

To support password update, the pam_ldap module can use the pam_authtok_store module with the server_policy option. When you use pam_authtok_store, the new password is sent to the LDAP server unencrypted. Use TLS to ensure privacy. Otherwise, the new userPassword becomes subject to snooping.

If you set an untagged password with ODSEE, the software uses the passwordStorageScheme attribute to encrypt the password. For more information about the passwordStorageScheme attribute, see Directory Server Password Policy in Oracle® Fusion Middleware Administrator's Guide for Oracle Directory Server Enterprise Edition.

If NIS or any other client that uses UNIX authentication uses LDAP as a repository, then you must configure the passwordStorageScheme attribute with crypt. Also, if you use sasl/digest-MD5 LDAP authentication with the ODSEE, you must configure the passwordStorageScheme attribute to clear text.