pam_pwdb
Cristian Gafton <gafton@sorosis.ro>
and Andrew G. Morgan <morgan@parc.power.net>
Authors.
account; authentication; password; session
Requires properly configured libpwdb
This module is a pluggable replacement for the pam_unix_..
modules. It uses the generic interface of the Password Database
library
http://parc.power.net/morgan/libpwdb/index.html
.
debug
The debug
argument makes the accounting functions of this module
syslog(3)
more information on its actions. (Remaining arguments
supported by the other functions of this module are silently ignored,
but others are logged as errors through syslog(3)
).
Based on the following pwdb_element
s:
expire
;
last_change
;
max_change
;
defer_change
;
warn_change
,
this module performs the task of establishing the status of the user's
account and password. In the case of the latter, it may offer advice
to the user on changing their password or, through the
PAM_AUTHTOKEN_REQD
return, delay giving service to the user until
they have established a new password. The entries listed above are
documented in the Password Database Library Guide (see pointer
above). Should the user's record not contain one or more of these
entries, the corresponding shadow check is not performed.
In its accounting mode, this module can be inserted as follows:
#
# Ensure users account and password are still active
#
login account required pam_pwdb.so
debug
;
use_first_pass
;
try_first_pass
;
nullok
The debug
argument makes the authentication functions of this
module syslog(3)
more information on its actions.
The default action of this module is to not permit the user access to
a service if their official password is blank. The nullok
argument overrides this default.
When given the argument try_first_pass
, before prompting the user
for their password, the module first tries the previous stacked
auth
-module's password in case that satisfies this module as
well. The argument use_first_pass
forces the module to use such a
recalled password and will never prompt the user - if no password is
available or the password is not appropriate, the user will be denied
access.
Remaining arguments, supported by the other functions of this module,
are silently ignored. Other arguments are logged as errors through
syslog(3)
.
A helper binary, pwdb_chkpwd
, is provided to check the user's
password when it is stored in a read protected database. This binary
is very simple and will only check the password of the user invoking
it. It is called transparently on behalf of the user by the
authenticating component of this module. In this way it is possible
for applications like xlock to work without being setuid-root.
The correct functionality of this module is dictated by having an
appropriate /etc/pwdb.conf
file, the user
databases specified there dictate the source of the authenticated
user's record.
debug
; nullok
; not_set_pass
; use_authtok
;
try_first_pass
; use_first_pass
; md5
; shadow
;
radius
This part of the pam_pwdb
module performs the task of updating
the user's password. Thanks to the flexibility of libpwdb
this
module is able to move the user's password from one database to
another, perhaps securing the user's database entry in a dynamic
manner (this is very ALPHA code at the moment!) - this is the
purpose of the shadow
and radius
arguments.
In the case of conventional unix databases (which store the password
encrypted) the md5
argument is used to do the encryption with the
MD5 function as opposed to the conventional crypt(3)
call.
The nullok
module is used to permit the changing of a password
from an empty one. Without this argument, empty passwords are
treated as account-locking ones.
The argument use_first_pass
is used to lock the choice of old and
new passwords to that dictated by the previously stacked password
module. The try_first_pass
argument is used to avoid the user
having to re-enter an old password when pam_pwdb
follows a module
that possibly shared the user's old password - if this old password is
not correct the user will be prompted for the correct one. The
argument use_authtok
is used to force this module to set the
new password to the one provided by the previously stacked
password
module (this is used in an example of the stacking of
the Cracklib module documented above).
The not_set_pass
argument is used to inform the module that it is
not to pay attention to/make available the old or new passwords from/to
other (stacked) password modules.
The debug
argument makes the password functions of this module
syslog(3)
more information on its actions. Other arguments may be
logged as erroneous to syslog(3)
.
An example of the stacking of this module with respect to the
pluggable password checking module, pam_cracklib
, is given in
that modules section above.
No arguments are recognized by this module component. Its action is
simply to log the username and the service-type to
syslog(3)
. Messages are logged at the beginning and end of the
user's session.
The use of the session modules is straightforward:
#
# pwdb - unix like session opening and closing
#
login session required pam_pwdb.so