The reader should note that the Linux-PAM specific tokens in this file are case insensitive. The module paths, however, are case sensitive since they indicate a file's name and reflect the case dependence of typical Linux file-systems. The case-sensitivity of the arguments to any given module is defined for each module in turn.
In addition to the lines described below, there are two special
characters provided for the convenience of the system administrator:
comments are preceded by a `#
' and extend to the
next end-of-line; also, module specification lines may be extended
with a `\
' escaped newline.
A general configuration line of the /etc/pam.conf
file has
the following form:
service-name module-type control-flag module-path arguments
Below, we explain the meaning of each of these tokens. The second (and
more recently adopted) way of configuring Linux-PAM is via the
contents of the /etc/pam.d/
directory. Once we have explained
the meaning of the above tokens, we will describe this method.
service-name
The name of the service associated with this entry. Frequently the
service name is the conventional name of the given application. For
example, `ftpd
', `rlogind
' and `su
', etc. .
There is a special service-name
, reserved for defining a default
authentication mechanism. It has the name `OTHER
' and may be
specified in either lower or upper case characters. Note, when there
is a module specified for a named service, the `OTHER
' entries
are ignored.
module-type
One of (currently) four types of module. The four types are as follows:
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 (independently of the
/etc/groups
file discussed above) or other privileges through
its credential granting properties.
account
; this module 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.
session
; primarily, this module 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. .
password
; this last 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
)
module-type.
control-flag
One of (currently) four tokens that indicate the severity of concern
associated with the success or failure of a given module.
Linux-PAM provides for the stacking of similar modules,
providing a method of sequentially exposing the user to more than one
authentication mechanism per service application. The application is
not made aware of the individual success or failure of modules listed
in the `/etc/pam.conf
' file. Instead, it receives a summary
success or fail response from the Linux-PAM
library. The order of execution of these modules is that of the
entries in the /etc/pam.conf
file; earlier entries are
executed before later ones.
The policy for determining this response is based on these
three control-flag
s:
required
; this indicates that the success of the module is
required for the module-type
facility to succeed. Failure of this
module will not be apparent to the user until all of the remaining
modules (of the same module-type
) have been executed.
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
; the success of this module is deemed
`sufficient' to satisfy the Linux-PAM library that this
module-type has succeeded in its purpose. In the event that no
previous required
module has failed, no more `stacked'
modules of this type are invoked. (Note, in this case subsequent
required
modules are not invoked.). A failure of this module
is not deemed as fatal to satisfying the application that this
module-type
has succeeded.
optional
; as its name suggests, this control-flag
marks the module as not being critical to the success or failure of
the user's application for service. However, in the absence of any
successes of previous or subsequent stacked modules this module will
determine the nature of the response to the application.
module-path
The path-name of the dynamically loadable object file; the
pluggable module itself. If the first character of the module path is
`/
', it is assumed to be a complete path. If this is not the
case, the given module path is appended to the default module path:
/usr/lib/security
(but see the notes
above).
args
The args
are a list of tokens that are passed to the module when
it is invoked. Much like arguments to a typical Linux shell command.
Generally, valid arguments are optional and are specific to any given
module. Invalid arguments are ignored by a module, however, when
encountering an invalid argument, the module is required to write an
error to syslog(3)
. For a list of generic options see the
next section.
Any line, in /etc/pam.conf
, that is not formatted correctly
is ignored by Linux-PAM; however, a corresponding error is
written to the system log files with a call to syslog(3)
.