table of contents
PAM.CONF(5) | Linux-PAM Manual | PAM.CONF(5) |
NAME
DESCRIPTION
this module type performs non-authentication
based account management. It is typically used to restrict/permit access to a
service based on the time of day, currently available system resources
(maximum number of users) or perhaps the location of the applicant user --
´root´ login only on the console.
auth
this module type provides two aspects of
authenticating the user. Firstly, it establishes that the user is who they
claim to be, by instructing the application to prompt the user for a password
or other means of identification. Secondly, the module can grant group
membership or other privileges through its credential granting
properties.
password
this module type is required for updating the
authentication token associated with the user. Typically, there is one module
for each ´challenge/response´ based authentication (auth)
type.
session
this module type is associated with doing
things that need to be done for the user before/after they can be given
service. Such things include the logging of information concerning the
opening/closing of some data exchange with a user, mounting directories,
etc.
If the type value from the list above is prepended with a -
character the PAM library will not log to the system log if it is not possible
to load the module because it is missing in the system. This can be useful
especially for modules which are not always installed on the system and are
not required for correct authentication and authorization of the login
session.
The third field, control, indicates the behavior of the PAM-API should
the module fail to succeed in its authentication task. There are two types of
syntax for this control field: the simple one has a single simple keyword; the
more complicated one involves a square-bracketed selection of
value=action pairs.
For the simple (historical) syntax valid control values are:
required
failure of such a PAM will ultimately lead to
the PAM-API returning failure but only after the remaining stacked
modules (for this service and type) have been invoked.
requisite
like required, however, in the case
that such a module returns a failure, control is directly returned to the
application. The return value is that associated with the first required or
requisite module to fail. Note, this flag can be used to protect against the
possibility of a user getting the opportunity to enter a password over an
unsafe medium. It is conceivable that such behavior might inform an attacker
of valid accounts on a system. This possibility should be weighed against the
not insignificant concerns of exposing a sensitive password in a hostile
environment.
sufficient
success of such a module is enough to satisfy
the authentication requirements of the stack of modules (if a prior
required module has failed the success of this one is ignored).
A failure of this module is not deemed as fatal to satisfying the application
that this type has succeeded. If the module succeeds the PAM framework returns
success to the application immediately without trying any other modules.
optional
the success or failure of this module is only
important if it is the only module in the stack associated with this
service+ type.
include
include all lines of given type from the
configuration file specified as an argument to this control.
substack
include all lines of given type from the
configuration file specified as an argument to this control. This differs from
include in that evaluation of the done and die actions in
a substack does not cause skipping the rest of the complete module stack, but
only of the substack. Jumps in a substack also can not make evaluation jump
out of it, and the whole substack is counted as one module when the jump is
done in a parent stack. The reset action will reset the state of a
module stack to the state it was in as of beginning of the substack
evaluation.
For the more complicated syntax valid control values have the following
form:
[value1=action1 value2=action2 ...]
when used with a stack of modules, the
module´s return status will not contribute to the return code the
application obtains.
bad
this action indicates that the return code
should be thought of as indicative of the module failing. If this module is
the first in the stack to fail, its status value will be used for that of the
whole stack.
die
equivalent to bad with the side effect of
terminating the module stack and PAM immediately returning to the
application.
ok
this tells PAM that the administrator thinks
this return code should contribute directly to the return code of the full
stack of modules. In other words, if the former state of the stack would lead
to a return of PAM_SUCCESS, the module´s return code will override
this value. Note, if the former state of the stack holds some value that is
indicative of a modules failure, this ´ok´ value will not be used to
override that value.
done
equivalent to ok with the side effect of
terminating the module stack and PAM immediately returning to the
application.
N (an unsigned integer)
equivalent to ok with the side effect of
jumping over the next N modules in the stack. Note that N equal to 0 is not
allowed (and it would be identical to ok in such case).
reset
clear all memory of the state of the module
stack and start again with the next stacked module.
Each of the four keywords: required; requisite; sufficient; and optional, have
an equivalent expression in terms of the [...] syntax. They are as follows:
required
[success=ok new_authtok_reqd=ok ignore=ignore
default=bad]
requisite
[success=ok new_authtok_reqd=ok ignore=ignore
default=die]
sufficient
[success=done new_authtok_reqd=done
default=ignore]
optional
[success=ok new_authtok_reqd=ok
default=ignore]
squid auth required pam_mysql.so user=passwd_query passwd=mada \ db=eminence [query=select user_name from internet_service \ where user_name=´%u´ and password=PASSWORD(´%p´) and \ service=´web_proxy´]
[..[..\]..] --> ..[..]..
type control module-path module-arguments
SEE ALSO
10/27/2010 | Linux-PAM Manual |