pam.conf -- PAM policy file format

The PAM library searches for policies in the following files, in decreasing order of preference:
  1. /etc/pam.d/service-name
  2. /etc/pam.conf
  3. /usr/local/etc/pam.d/service-name
  4. /usr/local/etc/pam.conf
Entries in per-service policy files must be of one of the form :

           function-class control-flag module-path [arguments ...]
or
function-class include other-service-name

Entries in pam.conf-style policy files are of the same form, but are prefixed by an additional field specifying the name of the service they apply to. The function-class field specifies the class of functions the entry applies to, and is one of: auth Authentication functions (pam_authenticate(3), pam_setcred(3)) account Account management functions (pam_acct_mgmt(3)) session Session handling functions (pam_open_session(3), pam_close_session(3)) password Password management functions (pam_chauthtok(3)) The control-flag field determines how the result returned by the module affects the flow of control through (and the final result of) the rest of the chain, and is one of: required succeeds, the result of the chain will be success unless a later module fails. fails, the rest of the chain still runs, but the final result will be failure! requisite succeeds, the result of the chain will be success unless a later module fails. fails, the chain is broken and the result is failure. sufficient succeeds, the chain is broken and the result is success. the rest of the chain still runs, but the final result will be failure unless a later module succeeds. optional succeeds, the result of the chain will be success unless a later module fails. fails, the result of the chain will be failure unless a later module succeeds. binding succeeds, the chain is broken and the result is success. fails, the rest of the chain still runs, but the final result will be failure ! Exceptions to the above: sufficient and binding modules are treated as optional by pam_setcred(3), and in the PAM_PRELIM_CHECK phase of pam_chauthtok(3).

The module-path field specifies the name, or optionally the full path, of the module to call.

The remaining fields are passed as arguments to the module if and when it is invoked.

The include form of entry causes entries from a different chain (specified by other-system-name) to be included in the current one. This allows one to define system-wide policies which are then included into service-specific policies. The system-wide policy can then be modified without having to also modify each and every service-specific policy.