4.2. Directory based configuration

More flexible than the single configuration file is it to configure libpam via the contents of pam.d directories. In this case the directories are filled with files each of which has a filename equal to a service-name (in lower-case): it is the personal configuration file for the named service.

Vendor-supplied PAM configuration files might be installed in the system directory /usr/lib/pam.d/ or a configurable vendor specific directory instead of the machine configuration directory /etc/pam.d/. If no machine configuration file is found, the vendor-supplied file is used. All files in /etc/pam.d/ override files with the same name in other directories.

The syntax of each file in pam.d is similar to that of the /etc/pam.conf file and is made up of lines of the following form:

type  control  module-path  module-arguments
    

The only difference being that the service-name is not present. The service-name is of course the name of the given configuration file. For example, /etc/pam.d/login contains the configuration for the login service.