pam_ldap(5)
π pam_ldap(5) π
File Formats Manual Β· the LDAP pluggable authentication module π¦
β¨ NAME β¨
pam_ldap β LDAP pluggable authentication module
πΈ DESCRIPTION πΈ
okay bestie, sit down, hydrate, because this one is the module. The pam_ldap module is a Pluggable Authentication Module (PAM) which provides for authentication, authorization and password changing against LDAP servers. it's giving "one module, three jobs, zero complaints" π
Features of the PADL pam_ldap module include support for transport layer security, SASL authentication, directory server-enforced password policy, and host- and group- based logon authorization. like. it does a lot. queen behaviour fr fr π
The present version of pam_ldap supports AIX 5L, FreeBSD 3.x and above, HP-UX 11i, IRIX 6.x, Linux, Mac OS X 10.2 and above, and Solaris 2.6 and above. Many vendors provide their own LDAP authentication providers, often also called pam_ldap. β οΈ This manual page applies to the PADL pam_ldap module only. If you are using a vendor provided module, consult the relevant documentation instead. no cap, don't come for me if you're on somebody else's fork π
When authenticating or authorizing a user, pam_ldap first maps the user's login name to a distinguished name by searching the directory server. This must be possible using the local system's identity, specified in ldap.conf. (Note that presently only simple authentication is supported for authenticating in this initial step.) so like, step one is a search, and step one is lowkey simple-auth only. noted. π
To authenticate a user, pam_ldap attempts to bind to the directory server using the distinguished name of the user (retrieved previously). Both simple and SASL authentication mechanisms are supported; in the former case, one should take care to use transport security to prevent the user's password being transmitted in the clear. π¨ bestie. use transport security with simple binds. that password is just out there otherwise. not the vibe. π
A variety of authorization primitives are supported by pam_ldap, discussed in the configuration section below.
Finally, pam_ldap supports a number of password change protocols used by directory servers from various vendors. (Some directory servers support more than one password change protocol.) multi-talented β¨
Whilst pam_ldap is generally configured in the system LDAP naming configuration file (ldap.conf), some options can be configured in the PAM configuration file, to allow for per-service granularity. These options include the path to the LDAP naming configuration file to use, so in effect all options can be configured on a per-service basis. Options are listed below under PAM Configuration. (that's the part 2 energy, stay tuned π)
π CONFIGURATION π
pam_ldap stores its configuration in the ldap.conf file. (It should be noted that some LDAP client libraries, such as OpenLDAP, also use a configuration file of the same name. pam_ldap supports many of the same configuration file options as OpenLDAP, but it adds several that are specific to the functionality it provides. It is not guaranteed that pam_ldap will continue to match the configuration file semantics of OpenLDAP. You may wish to use different files.) π«Ά like, sharing a filename is not the same as sharing a destiny, yk?
Configuration file options consist of a keyword followed by a space and any arguments. The following options are supported by both pam_ldap and the PADL nss_ldap module:
host <name:port ...>β Specifies the name(s) or IP address(es) of the LDAP server(s) to connect to. In the case thatnss_ldapis used for host name resolution, each server should be specified as an IP address or name that can be resolved without using LDAP. Multiple servers may be specified, each separated by a space. The failover time depends on whether the LDAP client library supports configurable network or connect timeouts (seebind_timelimitbelow). π¦base <base>β Specifies the default base distinguished name (DN) to use for searches.uri <ldap[is]://[name[:port]] ...>β For LDAP client libraries that support it, specifies the URI(s) of the LDAP server(s) to connect to. The URI scheme may beldap,ldapi, orldaps, specifying LDAP over TCP, IPC and SSL respectively. If applicable, a port number can be specified; the default port number for the selected protocol is used if omitted. β οΈ This option takes precedence over thehostoption; it is not possible to combine the two.ldap_version <version>β Specifies the version of the LDAP protocol to use. Presently version must be2or3. The default is to use the maximum version supported by the client library.binddn <binddn>β Specifies the distinguished name with which to bind to the directory server(s). This option is optional; the default is to bind anonymously.bindpw <bindpw>β Specifies the cleartext credentials with which to bind. This option is only applicable when used withbinddnabove. The default is no credential (anonymous bind). When binding to the directory using SASL or other authentication mechanisms apart from simple binds, this option is not used. π bestie that says cleartext.rootbinddn <binddn>β This option has the same syntax and effect as thebinddnoption above, except it applies when the effective user ID is zero. If not specified, then the identity specified inbinddnis used instead. Because the configuration file may be readable by many users, the root bind DN credentials are stored in theldap.secretfile instead. This file is usually in the same directory as the configuration file. πport <port>β Specifies the port to connect to; this option is used with thehostoption, and is ignored with theurioption.scope <sub|one|base>β Specifies the search scope (subtree, one level or base object). The default scope issubtree;basescope is almost never useful for nameservice lookups.deref <never|searching|finding|always>β Specifies the policy for dereferencing aliases. The default policy is to never dereference aliases.timelimit <timelimit>β Specifies the time limit (in seconds) to use when performing searches. A value of zero (0), which is the default, is to wait indefinitely for searches to be completed. π she'll wait forever.bind_timelimit <timelimit>β Specifies the time limit (in seconds) to use when connecting to the directory server. This is distinct from the time limit specified intimelimitand affects the initial server connection only. (Server connections are otherwise cached.) Only some LDAP client libraries have the underlying functionality necessary to support this option. The default bind timelimit is 30 seconds.referrals <yes|no>β Specifies whether automatic referral chasing should be enabled. The default behaviour is specified by the LDAP client library.restart <yes|no>β Specifies whether the LDAP client library should restart theselect(2)system call when interrupted. This feature is not supported by all client libraries.logdir <directory>β Specifies the directory used for logging by the LDAP client library. This feature is not supported by all client libraries.debug <level>β Specifies the debug level used for logging by the LDAP client library. This feature is not supported by all client libraries, and does not apply to thenss_ldapandpam_ldapmodules themselves (debugging, if any, is configured separately and usually at compile time).ssl <on|off|start_tls>β Specifies whether to use SSL/TLS or not (the default is not to). Ifstart_tlsis specified then StartTLS is used rather than raw LDAP over SSL. Not all LDAP client libraries support both SSL and StartTLS, and all related configuration options.sslpath <cert7_path>β For the Netscape and Mozilla LDAP client libraries only, this specifies the path to the X.509 certificate database.tls_checkpeer <yes|no>β Specifies whether to require and verify the server certificate or not, when using SSL/TLS with the OpenLDAP client library. The default is to use the default behaviour of the client library; for OpenLDAP 2.0 and earlier it is"no", for OpenLDAP 2.1 and later it is"yes". β οΈ At least one oftls_cacertdirandtls_cacertfileis required if peer verification is enabled.tls_cacertdir <certificate_dir>β Specifies the directory containing X.509 certificates for peer authentication.tls_cacertfile <certificate_file>β Specifies the path to the X.509 certificate for peer authentication.tls_randfile <entropy_file>β Specifies the path to an entropy source.tls_ciphers <ciphers>β Specifies the ciphers to use for TLS. See your TLS implementation's documentation for further information.tls_cert <certificate_file>β Specifies the path to the file containing the local certificate for client TLS authentication.tls_key <key_file>β Specifies the path to the file containing the private key for client TLS authentication.
π pam_ldap-only options π
The following configuration options apply to pam_ldap only:
pam_login_attribute <attribute>β Specifies the attribute to use when constructing the attribute value assertion for retrieving a directory entry for a user's login name. The default is"uid", for compatibility with RFC 2307.pam_filter <filter>β Specifies a filter to use when retrieving user information. The user entry must match the attribute value assertion of(pam_login_attribute=login_name)as well as any filter specified here. There is no default for this option.pam_lookup_policy <yes|no>β Specifies whether to search the root DSE for password policy. The default is"no".pam_check_host_attr <yes|no>β Specifies whether the"host"attribute should be checked for logon authorization ("account"in the PAM stack). The default is not to. If set to"yes"and a user has no value for the"host"attribute, then the user will be unable to login. πpam_check_service_attr <yes|no>β Specifies whether the"authorizedService"attribute should be checked for logon authorization ("account"in the PAM stack). The default is not to. If set to"yes"and a user has no value for the"authorizedService"attribute, then the user will be unable to login. πpam_groupdn <groupdn>β Specifies the distinguished name of a group to which a user must belong for logon authorization to succeed.pam_member_attribute <attribute>β Specifies the attribute to use when testing a user's membership of a group specified in thepam_groupdnoption.pam_min_uid <uid>β If specified, a user must have a POSIX user ID of at least uid in order for logon authorization to succeed.
more CONFIGURATION options, bestie β these are the global ones and they're lowkey carrying the whole auth vibe π
pam_max_uid <uid>β if this is set, a user has to have a POSIX user ID that's no greater than uid for logon authorization to actually succeed. no cap, it's a hard cutoff.pam_template_login_attribute <attribute>β when you're using template users (which, btw, not all PAM applications support), this says which attribute holds the user's actual login name. thepam_ldapmodule will setPAM_USERto the value of that attribute if it's present in the user's entry. if it's not there, it defaults to the user specified in thepam_template_loginoption. slay.pam_template_login <user>β again, template users, not supported by every PAM app.pam_ldapwill setPAM_USERto the value of this option if the user doesn't contain a template login attribute. it's giving fallback realness.pam_password <protocol>β this picks the password change protocol, and there are a bunch, so let's go one by one:clearβ change password using anLDAPModifyrequest, replacing theuserPasswordvalue with the new cleartext password.clear_remove_oldβ change password using anLDAPModifyrequest, first removing theuserPasswordvalue containing the old cleartext password, and then adding theuserPasswordvalue with the new cleartext password. this protocol is necessary for use with Novell NDS and IBM RACF.cryptβ change password using anLDAPModifyrequest, first generating a one way hash of the new password usingcrypt(3)and then replacinguserPasswordvalue with the new hashed password.md5β change password using anLDAPModifyrequest, first generating a one way hash of the new password using MD5 and then replacinguserPasswordvalue with the new hashed password.ndsβ this is an alias forclear_remove_old.racfβ this is an alias forclear_remove_old.adβ change password using anLDAPModifyrequest, using the Active Directory Services Interface (ADSI) password change protocol.exopβ change password using the RFC 3062 password modify extended operation (only the new password is sent).exop_send_oldβ change password using the RFC 3062 password modify extended operation (both the old and new passwords are sent).
pam_password_prohibit_message <message>β this sets a message to send to users telling them passwords cannot be changed. you could use it to redirect users to another way of changing passwords. iconic redirection energy.pam_sasl_mech <mechanism>β this specifies the SASL mechanism to use for PAM authentication. it requires SASL libraries to be installed. support for this functionality is presently experimental and does not support password policy controls. so, like, be aware bestie π«Ά
π PAM CONFIGURATION π
it is possible to configure some aspects of pam_ldap on a per-service basis, in the PAM configuration file β this is usually /etc/pam.conf; for PAM implementations based on Linux-PAM, per-service files in /etc/pam.d are also supported. so you've got options, periodt.
the following options may be specified as arguments to the pam_ldap module:
config=<path>β specifies thatpam_ldapshould use the configuration file in path instead ofldap.confto retrieve its global configuration. configuring multiple instances ofpam_ldapfor the same service with different configuration files is not supported, because the configuration information is cached. so don't try it, bestie, it will not slay.use_first_passβ specifies thatpam_ldapshould always use the first password provided in the authentication stack. no asking again, just take the first one.try_first_passβ specifies thatpam_ldapshould first try the first password provided in the authentication stack, and then prompt the user for their LDAP password if authentication fails. it's giving "one shot, then ask nicely."ignore_unknown_userβ specifies thatpam_ldapshould returnPAM_IGNOREfor users that are not present in LDAP. this forces the PAM framework to ignore thepam_ldapmodule. this option is useful where certain accounts do not reside in LDAP, but one wishes to makepam_ldap"required" for all accounts in the directory. in this case one would make bothpam_ldapand the other module (for example,pam_unix) "required" and enable theignore_unknown_useroption. (for this to work, the other module must behave similarly for users in the directory; in the case of a module such aspam_unixthat uses the system accounts database, usingnss_ldap(5)should be sufficient to meet this requirement.) iykyk.ignore_authinfo_unavailβ specifies thatpam_ldapshould returnPAM_IGNOREif it cannot contact the LDAP server. this option forces the PAM framework to ignore thepam_ldapmodule in this case. no server? no problem, we ignore.no_warnβ specifies that warning messages should not be propagated to the PAM application. keep the warnings to yourself, bestie.use_authtokβ analogous touse_first_passfor password changing only. same vibe, different context.debugβ this option is recognized bypam_ldapbut is presently ignored. so it's there, but it's not doing anything. ghost option energy π
π AUTHOR π
the pam_ldap module was developed by PADL Software Pty Ltd (www.padl.com). absolute legends, fr fr.
π¦ FILES π¦
/etc/ldap.conf/etc/ldap.secret/etc/pam.conf
π SEE ALSO π
and that's the whole pam_ldap(5) page, bestie β the footer says pam_ldap(5), that's your source/version, and the date is whatever date is chillin' on your man page footer. mwah π
β¨π
π¦ where this page comes from
- ubuntu jammy: libpam-ldap 186-4ubuntu2 Β· GPL-2.0-or-later
- ubuntu noble: libpam-ldap 186-4.1ubuntu1 Β· GPL-2.0-or-later
- Copyright 1997-2005 Luke Howard."
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms