HP-UX Reference (11i v2 03/08) - 4 File Formats (vol 8)

p
pam.conf(4) pam.conf(4)
Integrating Multiple Authentication Services With Stacking
When a service_name of the same module_type is defined more than once, the service is said to be
stacked . Each module referenced in the module_path for that service is then processed in the order that
it occurs in the configuration file. The control_flag field specifies the continuation and failure semantics
of the modules, and may be
required,
optional,orsufficient.
The PAM framework processes each service module in the stack. If all
required modules in the stack
succeed, then success is returned (
optional and
sufficient error values are ignored). If one or
more
required modules fail, then the error value from the first
required module that failed is
returned.
If none of the service modules in the stack are designated as
required, then the PAM framework
requires that at least one
optional or
sufficient module succeed. If all fail then the error value
from the first service module in the stack is returned.
The only exception to the above is caused by the
sufficient flag. If a service module that is desig-
nated as
sufficient succeeds, then the PAM framework immediately returns success to the applica-
tion (all subsequent services modules, even required ones, in the stack are ignored), given that all
prior required modules had also succeeded. If a prior
required module failed, then the error value
from that module is returned.
If a module does not exist or can not be opened, then the
pam.conf entry is ignored and an error will be
logged through syslog (3C) at the LOG_CRIT level.
Below is a sample configuration file that stacks the
login, and dtlogin services.
login auth required /usr/lib/security/$ISA/libpam_unix.so.1. debug
login auth optional /usr/lib/security/$ISA/libpam_inhouse.so.1
dtlogin auth sufficient /usr/lib/security/$ISA/libpam_unix.so.1 debug
dtlogin auth required /usr/lib/security/$ISA/libpam_inhouse.so.1
In the case of
login, the user is authenticated by the UNIX and inhouse authentication modules. The
required keyword for control_flag requires that the user be allowed to login only if the user is authenti-
cated by the UNIX service module. Inhouse authentication is optional by virtue of the
optional key-
word in the control_flag field. The user can still log in even if inhouse authentication fails.
In the case of
dtlogin, the sufficient keyword for control_flag specifies that if the UNIX authenti-
cation check succeeds, then PAM should return success to dtlogin. The inhouse authentication module
(the next module in the stack) will only be invoked if the UNIX authentication check fails.
Some modules may return
PAM_IGNORE in certain situations. In these cases the PAM framework
ignores the entire entry in pam.conf regardless of whether or not it is required, optional
or suf-
ficient
.
Configuration Per User
pam.conf contains information to configure all the users on a system. But sometimes it is necessary to
configure user by user. A user policy definition is made through a specific module named
libpam_updbe.so.1. This module reads a file named /etc/pam_user.conf
which describes the
user’s configurations.
Below is a sample configuration file (
/etc/pam.conf) that uses the module libpam_updbe.so.1
.
login auth required /usr/lib/security/$ISA/libpam_updbe.so.1
login auth required /usr/lib/security/$ISA/libpam_unix.so.1
su auth required /usr/lib/security/$ISA/libpam_updbe.so.1
su auth required /usr/lib/security/$ISA/libpam_unix.so.1
OTHER auth required /usr/lib/security/$ISA/libpam_unix.so.1
login password required /usr/lib/security/$ISA/libpam_updbe.so.1
login password required /usr/lib/security/$ISA/libpam_unix.so.1
passwd password required /usr/lib/security/$ISA/libpam_updbe.so.1
passwd password required /usr/lib/security/$ISA/libpam_unix.so.1
OTHER password required /usr/lib/security/$ISA/libpam_unix.so.1
The module
libpam_updbe.so.1 searches the configuration file /etc/pam_user.conf and reads
the configuration associated with the login name of the current user. If there is no configuration concern-
ing the current user in the pam_user.conf file, the PAM framework ignores the line containing
libpam_updbe.so.1. The pam.conf applies for those users who are not configured in
pam_user.conf.
Section 4224 Hewlett-Packard Company 2 HP-UX 11i Version 2: August 2003