xref: /netbsd-src/external/bsd/openpam/dist/doc/man/pam.conf.5 (revision 0d9d0fd8a30be9a1924e715bbcf67a4a83efd262)
1*0d9d0fd8Schristos.\"	$NetBSD: pam.conf.5,v 1.11 2023/06/30 21:46:20 christos Exp $
244269bb5Schristos.\"
344269bb5Schristos.\"-
44cb4af11Schristos.\" Copyright (c) 2005-2017 Dag-Erling Smørgrav
544269bb5Schristos.\" All rights reserved.
644269bb5Schristos.\"
744269bb5Schristos.\" Redistribution and use in source and binary forms, with or without
844269bb5Schristos.\" modification, are permitted provided that the following conditions
944269bb5Schristos.\" are met:
1044269bb5Schristos.\" 1. Redistributions of source code must retain the above copyright
1144269bb5Schristos.\"    notice, this list of conditions and the following disclaimer.
1244269bb5Schristos.\" 2. Redistributions in binary form must reproduce the above copyright
1344269bb5Schristos.\"    notice, this list of conditions and the following disclaimer in the
1444269bb5Schristos.\"    documentation and/or other materials provided with the distribution.
1544269bb5Schristos.\" 3. The name of the author may not be used to endorse or promote
1644269bb5Schristos.\"    products derived from this software without specific prior written
1744269bb5Schristos.\"    permission.
1844269bb5Schristos.\"
1944269bb5Schristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2044269bb5Schristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2144269bb5Schristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2244269bb5Schristos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2344269bb5Schristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2444269bb5Schristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2544269bb5Schristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2644269bb5Schristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2744269bb5Schristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2844269bb5Schristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2944269bb5Schristos.\" SUCH DAMAGE.
3044269bb5Schristos.\"
31*0d9d0fd8Schristos.Dd June 27, 2023
3244269bb5Schristos.Dt PAM.CONF 5
3344269bb5Schristos.Os
3444269bb5Schristos.Sh NAME
3544269bb5Schristos.Nm pam.conf
3644269bb5Schristos.Nd PAM policy file format
3744269bb5Schristos.Sh DESCRIPTION
3844269bb5SchristosThe PAM library searches for policies in the following files, in
3944269bb5Schristosdecreasing order of preference:
4044269bb5Schristos.Bl -enum
4144269bb5Schristos.It
4244269bb5Schristos.Pa /etc/pam.d/ Ns Ar service-name
4344269bb5Schristos.It
4444269bb5Schristos.Pa /etc/pam.conf
45285d1f1dSchristos.\" .It
46285d1f1dSchristos.\" .Pa /usr/local/etc/pam.d/ Ns Ar service-name
47285d1f1dSchristos.\" .It
48285d1f1dSchristos.\" .Pa /usr/local/etc/pam.conf
4944269bb5Schristos.El
5044269bb5Schristos.Pp
5144269bb5SchristosIf none of these locations contains a policy for the given service,
5244269bb5Schristosthe
53e1b25b17Schristos.Dq Dv other
5444269bb5Schristospolicy is used instead, if it exists.
5544269bb5Schristos.Pp
5644269bb5SchristosEntries in per-service policy files must be of one of the two forms
5744269bb5Schristosbelow:
5844269bb5Schristos.Bd -unfilled -offset indent
5944269bb5Schristos.Ar facility control-flag module-path Op Ar arguments ...
6044269bb5Schristos.Ar facility Cm include Ar other-service-name
6144269bb5Schristos.Ed
6244269bb5Schristos.Pp
6344269bb5SchristosEntries in
6444269bb5Schristos.Pa pam.conf Ns -style
6544269bb5Schristospolicy files are of the same form, but are prefixed by an additional
6644269bb5Schristosfield specifying the name of the service they apply to.
6744269bb5Schristos.Pp
688fa0fefeSchristosIn both cases, blank lines and comments introduced by a
6944269bb5Schristos.Ql #
708fa0fefeSchristossign are ignored, and the normal shell quoting rules apply.
718fa0fefeSchristosThe precise details of how the file is tokenized are described in
728fa0fefeSchristos.Xr openpam_readword 3 .
7344269bb5Schristos.Pp
7444269bb5SchristosThe
7544269bb5Schristos.Ar facility
7644269bb5Schristosfield specifies the facility the entry applies to, and is one of:
778fa0fefeSchristos.Bl -tag -width 12n
7844269bb5Schristos.It Cm auth
7944269bb5SchristosAuthentication functions
8044269bb5Schristos.Po
8144269bb5Schristos.Xr pam_authenticate 3 ,
8244269bb5Schristos.Xr pam_setcred 3
8344269bb5Schristos.Pc
8444269bb5Schristos.It Cm account
8544269bb5SchristosAccount management functions
8644269bb5Schristos.Pq Xr pam_acct_mgmt 3
8744269bb5Schristos.It Cm session
8844269bb5SchristosSession handling functions
8944269bb5Schristos.Po
9044269bb5Schristos.Xr pam_open_session 3 ,
9144269bb5Schristos.Xr pam_close_session 3
9244269bb5Schristos.Pc
9344269bb5Schristos.It Cm password
9444269bb5SchristosPassword management functions
9544269bb5Schristos.Pq Xr pam_chauthtok 3
9644269bb5Schristos.El
9744269bb5Schristos.Pp
9844269bb5SchristosThe
9944269bb5Schristos.Ar control-flag
10044269bb5Schristosfield determines how the result returned by the module affects the
10144269bb5Schristosflow of control through (and the final result of) the rest of the
10244269bb5Schristoschain, and is one of:
1038fa0fefeSchristos.Bl -tag -width 12n
10444269bb5Schristos.It Cm required
10544269bb5SchristosIf this module succeeds, the result of the chain will be success
10644269bb5Schristosunless a later module fails.
10744269bb5SchristosIf it fails, the rest of the chain still runs, but the final result
10844269bb5Schristoswill be failure regardless of the success of later modules.
10944269bb5Schristos.It Cm requisite
11044269bb5SchristosIf this module succeeds, the result of the chain will be success
11144269bb5Schristosunless a later module fails.
11244269bb5SchristosIf the module fails, the chain is broken and the result is failure.
11344269bb5Schristos.It Cm sufficient
11444269bb5SchristosIf this module succeeds, the chain is broken and the result is
11544269bb5Schristossuccess.
11644269bb5SchristosIf it fails, the rest of the chain still runs, but the final result
11744269bb5Schristoswill be failure unless a later module succeeds.
11844269bb5Schristos.It Cm binding
11944269bb5SchristosIf this module succeeds, the chain is broken and the result is
12044269bb5Schristossuccess.
12144269bb5SchristosIf it fails, the rest of the chain still runs, but the final result
12244269bb5Schristoswill be failure regardless of the success of later modules.
12344269bb5Schristos.It Cm optional
12444269bb5SchristosIf this module succeeds, the result of the chain will be success
12544269bb5Schristosunless a later module fails.
12644269bb5SchristosIf this module fails, the result of the chain will be failure unless a
12744269bb5Schristoslater module succeeds.
12844269bb5Schristos.El
12944269bb5Schristos.Pp
13044269bb5SchristosThere are two exceptions to the above:
13144269bb5Schristos.Cm sufficient
13244269bb5Schristosand
13344269bb5Schristos.Cm binding
13444269bb5Schristosmodules are treated as
13544269bb5Schristos.Cm optional
13644269bb5Schristosby
13744269bb5Schristos.Xr pam_setcred 3 ,
13844269bb5Schristosand in the
13944269bb5Schristos.Dv PAM_PRELIM_CHECK
14044269bb5Schristosphase of
14144269bb5Schristos.Xr pam_chauthtok 3 .
14244269bb5Schristos.Pp
14344269bb5SchristosThe
14444269bb5Schristos.Ar module-path
1458fa0fefeSchristosfield specifies the name or full path of the module to call.
1468fa0fefeSchristosIf only the name is specified, the PAM library will search for it in
147285d1f1dSchristosthe following location:
1488fa0fefeSchristos.Bl -enum
1498fa0fefeSchristos.It
150285d1f1dSchristos.\" .Pa /usr/lib
151285d1f1dSchristos.Pa /usr/lib/security
152285d1f1dSchristos.\" .It
153285d1f1dSchristos.\" .Pa /usr/local/lib
1548fa0fefeSchristos.El
15544269bb5Schristos.Pp
1568fa0fefeSchristosThe remaining fields, if any, are passed unmodified to the module if
1578fa0fefeSchristosand when it is invoked.
15844269bb5Schristos.Pp
15944269bb5SchristosThe
16044269bb5Schristos.Cm include
16144269bb5Schristosform of entry causes entries from a different chain (specified by
16244269bb5Schristos.Ar other-system-name )
16344269bb5Schristosto be included in the current one.
16444269bb5SchristosThis allows one to define system-wide policies which are then included
16544269bb5Schristosinto service-specific policies.
16644269bb5SchristosThe system-wide policy can then be modified without having to also
16744269bb5Schristosmodify each and every service-specific policy.
1688fa0fefeSchristos.Pp
1698fa0fefeSchristos.Bf -symbolic
1708fa0fefeSchristosTake care not to introduce loops when using
1718fa0fefeSchristos.Cm include
1728fa0fefeSchristosrules, as there is currently no loop detection in place.
1738fa0fefeSchristos.Ef
1748fa0fefeSchristos.Sh MODULE OPTIONS
1758fa0fefeSchristosSome PAM library functions may alter their behavior when called by a
1768fa0fefeSchristosservice module if certain module options were specified, regardless of
1778fa0fefeSchristoswhether the module itself accords them any importance.
1788fa0fefeSchristosOne such option is
1798fa0fefeSchristos.Cm debug ,
1808fa0fefeSchristoswhich causes the dispatcher to enable debugging messages before
1818fa0fefeSchristoscalling each service function, and disable them afterwards (unless
1828fa0fefeSchristosthey were already enabled).
1838fa0fefeSchristosOther special options include:
1848fa0fefeSchristos.Bl -tag -width 12n
1858fa0fefeSchristos.It Cm authtok_prompt Ns = Ns Ar prompt , Cm oldauthtok_prompt Ns = Ns Ar prompt , Cm user_prompt Ns = Ns Ar prompt
1868fa0fefeSchristosThese options can be used to override the prompts used by
1878fa0fefeSchristos.Xr pam_get_authtok 3
1888fa0fefeSchristosand
1898fa0fefeSchristos.Xr pam_get_user 3 .
1908fa0fefeSchristos.It Cm echo_pass
1918fa0fefeSchristosThis option controls whether
1928fa0fefeSchristos.Xr pam_get_authtok 3
1938fa0fefeSchristoswill allow the user to see what they are typing.
1948fa0fefeSchristos.It Cm try_first_pass , Cm use_first_pass
1958fa0fefeSchristosThese options control
1968fa0fefeSchristos.Xr pam_get_authtok 3 Ns 's
1978fa0fefeSchristosuse of cached authentication tokens.
1988fa0fefeSchristos.El
19944269bb5Schristos.Sh SEE ALSO
20044269bb5Schristos.Xr pam 3
20144269bb5Schristos.Sh STANDARDS
20244269bb5Schristos.Rs
20344269bb5Schristos.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
20444269bb5Schristos.%D "June 1997"
20544269bb5Schristos.Re
20644269bb5Schristos.Sh AUTHORS
20744269bb5SchristosThe OpenPAM library was developed for the
20844269bb5Schristos.Fx
20944269bb5SchristosProject by ThinkSec AS and Network Associates Laboratories, the
21044269bb5SchristosSecurity Research Division of Network Associates, Inc.\& under
21144269bb5SchristosDARPA/SPAWAR contract N66001-01-C-8035
21244269bb5Schristos.Pq Dq CBOSS ,
21344269bb5Schristosas part of the DARPA CHATS research program.
21444269bb5Schristos.Pp
215e1b25b17SchristosThe OpenPAM library is maintained by
216a5684d07Swiz.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .
217