xref: /freebsd/contrib/openpam/doc/man/pam.conf.5 (revision 45538173c120eadca115fd7e56c657905bf73771)
1556dce83SDag-Erling Smørgrav.\"-
2*45538173SDag-Erling Smørgrav.\" Copyright (c) 2005-2025 Dag-Erling Smørgrav
3556dce83SDag-Erling Smørgrav.\" All rights reserved.
4556dce83SDag-Erling Smørgrav.\"
5556dce83SDag-Erling Smørgrav.\" Redistribution and use in source and binary forms, with or without
6556dce83SDag-Erling Smørgrav.\" modification, are permitted provided that the following conditions
7556dce83SDag-Erling Smørgrav.\" are met:
8556dce83SDag-Erling Smørgrav.\" 1. Redistributions of source code must retain the above copyright
9556dce83SDag-Erling Smørgrav.\"    notice, this list of conditions and the following disclaimer.
10556dce83SDag-Erling Smørgrav.\" 2. Redistributions in binary form must reproduce the above copyright
11556dce83SDag-Erling Smørgrav.\"    notice, this list of conditions and the following disclaimer in the
12556dce83SDag-Erling Smørgrav.\"    documentation and/or other materials provided with the distribution.
13556dce83SDag-Erling Smørgrav.\" 3. The name of the author may not be used to endorse or promote
14556dce83SDag-Erling Smørgrav.\"    products derived from this software without specific prior written
15556dce83SDag-Erling Smørgrav.\"    permission.
16556dce83SDag-Erling Smørgrav.\"
17556dce83SDag-Erling Smørgrav.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18556dce83SDag-Erling Smørgrav.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19556dce83SDag-Erling Smørgrav.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20556dce83SDag-Erling Smørgrav.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21556dce83SDag-Erling Smørgrav.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22556dce83SDag-Erling Smørgrav.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23556dce83SDag-Erling Smørgrav.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24556dce83SDag-Erling Smørgrav.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25556dce83SDag-Erling Smørgrav.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26556dce83SDag-Erling Smørgrav.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27556dce83SDag-Erling Smørgrav.\" SUCH DAMAGE.
28556dce83SDag-Erling Smørgrav.\"
29*45538173SDag-Erling Smørgrav.Dd May 31, 2025
30556dce83SDag-Erling Smørgrav.Dt PAM.CONF 5
31556dce83SDag-Erling Smørgrav.Os
32556dce83SDag-Erling Smørgrav.Sh NAME
33556dce83SDag-Erling Smørgrav.Nm pam.conf
34556dce83SDag-Erling Smørgrav.Nd PAM policy file format
35556dce83SDag-Erling Smørgrav.Sh DESCRIPTION
36556dce83SDag-Erling SmørgravThe PAM library searches for policies in the following files, in
37556dce83SDag-Erling Smørgravdecreasing order of preference:
38556dce83SDag-Erling Smørgrav.Bl -enum
39556dce83SDag-Erling Smørgrav.It
40556dce83SDag-Erling Smørgrav.Pa /etc/pam.d/ Ns Ar service-name
41556dce83SDag-Erling Smørgrav.It
42556dce83SDag-Erling Smørgrav.Pa /etc/pam.conf
43556dce83SDag-Erling Smørgrav.It
44556dce83SDag-Erling Smørgrav.Pa /usr/local/etc/pam.d/ Ns Ar service-name
45556dce83SDag-Erling Smørgrav.It
46556dce83SDag-Erling Smørgrav.Pa /usr/local/etc/pam.conf
47556dce83SDag-Erling Smørgrav.El
48556dce83SDag-Erling Smørgrav.Pp
49556dce83SDag-Erling SmørgravIf none of these locations contains a policy for the given service,
50556dce83SDag-Erling Smørgravthe
512f3ed619SDag-Erling Smørgrav.Dq Dv other
52556dce83SDag-Erling Smørgravpolicy is used instead, if it exists.
53556dce83SDag-Erling Smørgrav.Pp
54556dce83SDag-Erling SmørgravEntries in per-service policy files must be of one of the two forms
55556dce83SDag-Erling Smørgravbelow:
56556dce83SDag-Erling Smørgrav.Bd -unfilled -offset indent
57*45538173SDag-Erling Smørgrav.Oo "-" Oc Ns Ar facility control-flag module-path Op Ar arguments ...
58*45538173SDag-Erling Smørgrav.Oo "-" Oc Ns Ar facility Cm include Ar other-service-name
59556dce83SDag-Erling Smørgrav.Ed
60556dce83SDag-Erling Smørgrav.Pp
61556dce83SDag-Erling SmørgravEntries in
62556dce83SDag-Erling Smørgrav.Pa pam.conf Ns -style
63556dce83SDag-Erling Smørgravpolicy files are of the same form, but are prefixed by an additional
64556dce83SDag-Erling Smørgravfield specifying the name of the service they apply to.
65556dce83SDag-Erling Smørgrav.Pp
66ce77a8d6SDag-Erling SmørgravIn both cases, blank lines and comments introduced by a
6705640c12SDag-Erling Smørgrav.Ql #
68ce77a8d6SDag-Erling Smørgravsign are ignored, and the normal shell quoting rules apply.
69ce77a8d6SDag-Erling SmørgravThe precise details of how the file is tokenized are described in
70ce77a8d6SDag-Erling Smørgrav.Xr openpam_readword 3 .
71556dce83SDag-Erling Smørgrav.Pp
72556dce83SDag-Erling SmørgravThe
737f106882SDag-Erling Smørgrav.Ar facility
747f106882SDag-Erling Smørgravfield specifies the facility the entry applies to, and is one of:
75ce77a8d6SDag-Erling Smørgrav.Bl -tag -width 12n
76556dce83SDag-Erling Smørgrav.It Cm auth
77556dce83SDag-Erling SmørgravAuthentication functions
78556dce83SDag-Erling Smørgrav.Po
79556dce83SDag-Erling Smørgrav.Xr pam_authenticate 3 ,
80556dce83SDag-Erling Smørgrav.Xr pam_setcred 3
81556dce83SDag-Erling Smørgrav.Pc
82556dce83SDag-Erling Smørgrav.It Cm account
83556dce83SDag-Erling SmørgravAccount management functions
84556dce83SDag-Erling Smørgrav.Pq Xr pam_acct_mgmt 3
85556dce83SDag-Erling Smørgrav.It Cm session
86556dce83SDag-Erling SmørgravSession handling functions
87556dce83SDag-Erling Smørgrav.Po
88556dce83SDag-Erling Smørgrav.Xr pam_open_session 3 ,
89556dce83SDag-Erling Smørgrav.Xr pam_close_session 3
90556dce83SDag-Erling Smørgrav.Pc
91556dce83SDag-Erling Smørgrav.It Cm password
92556dce83SDag-Erling SmørgravPassword management functions
93556dce83SDag-Erling Smørgrav.Pq Xr pam_chauthtok 3
94556dce83SDag-Erling Smørgrav.El
95556dce83SDag-Erling Smørgrav.Pp
96556dce83SDag-Erling SmørgravThe
97*45538173SDag-Erling Smørgrav.Ar facility
98*45538173SDag-Erling Smørgravfield may optionally be preceded by a dash
99*45538173SDag-Erling Smørgrav.Pq Ql - ,
100*45538173SDag-Erling Smørgravwhich indicates that failure to load the specified module (or policy
101*45538173SDag-Erling Smørgravif the
102*45538173SDag-Erling Smørgrav.Ar control-flag is
103*45538173SDag-Erling Smørgrav.Cm include )
104*45538173SDag-Erling Smørgravshould not be considered a fatal error.
105*45538173SDag-Erling SmørgravThis is intended for situations where it is desirable to share a
106*45538173SDag-Erling Smørgravsingle policy across multiple systems, but certain additional modules
107*45538173SDag-Erling Smørgravor policies may only be present on some of them.
108*45538173SDag-Erling Smørgrav.Pp
109*45538173SDag-Erling SmørgravThe
110556dce83SDag-Erling Smørgrav.Ar control-flag
111556dce83SDag-Erling Smørgravfield determines how the result returned by the module affects the
112556dce83SDag-Erling Smørgravflow of control through (and the final result of) the rest of the
113556dce83SDag-Erling Smørgravchain, and is one of:
114ce77a8d6SDag-Erling Smørgrav.Bl -tag -width 12n
115556dce83SDag-Erling Smørgrav.It Cm required
116556dce83SDag-Erling SmørgravIf this module succeeds, the result of the chain will be success
117556dce83SDag-Erling Smørgravunless a later module fails.
118556dce83SDag-Erling SmørgravIf it fails, the rest of the chain still runs, but the final result
119556dce83SDag-Erling Smørgravwill be failure regardless of the success of later modules.
120556dce83SDag-Erling Smørgrav.It Cm requisite
121556dce83SDag-Erling SmørgravIf this module succeeds, the result of the chain will be success
122556dce83SDag-Erling Smørgravunless a later module fails.
123b5a3d78aSDag-Erling SmørgravIf the module fails, the chain is broken and the result is failure.
124556dce83SDag-Erling Smørgrav.It Cm sufficient
125556dce83SDag-Erling SmørgravIf this module succeeds, the chain is broken and the result is
126556dce83SDag-Erling Smørgravsuccess.
127556dce83SDag-Erling SmørgravIf it fails, the rest of the chain still runs, but the final result
128556dce83SDag-Erling Smørgravwill be failure unless a later module succeeds.
129556dce83SDag-Erling Smørgrav.It Cm binding
130556dce83SDag-Erling SmørgravIf this module succeeds, the chain is broken and the result is
131556dce83SDag-Erling Smørgravsuccess.
132556dce83SDag-Erling SmørgravIf it fails, the rest of the chain still runs, but the final result
133556dce83SDag-Erling Smørgravwill be failure regardless of the success of later modules.
134556dce83SDag-Erling Smørgrav.It Cm optional
135556dce83SDag-Erling SmørgravIf this module succeeds, the result of the chain will be success
136556dce83SDag-Erling Smørgravunless a later module fails.
137556dce83SDag-Erling SmørgravIf this module fails, the result of the chain will be failure unless a
138556dce83SDag-Erling Smørgravlater module succeeds.
139556dce83SDag-Erling Smørgrav.El
140556dce83SDag-Erling Smørgrav.Pp
141556dce83SDag-Erling SmørgravThere are two exceptions to the above:
142556dce83SDag-Erling Smørgrav.Cm sufficient
143556dce83SDag-Erling Smørgravand
144556dce83SDag-Erling Smørgrav.Cm binding
145556dce83SDag-Erling Smørgravmodules are treated as
146556dce83SDag-Erling Smørgrav.Cm optional
147556dce83SDag-Erling Smørgravby
148556dce83SDag-Erling Smørgrav.Xr pam_setcred 3 ,
149556dce83SDag-Erling Smørgravand in the
150556dce83SDag-Erling Smørgrav.Dv PAM_PRELIM_CHECK
151556dce83SDag-Erling Smørgravphase of
152556dce83SDag-Erling Smørgrav.Xr pam_chauthtok 3 .
153556dce83SDag-Erling Smørgrav.Pp
154556dce83SDag-Erling SmørgravThe
155556dce83SDag-Erling Smørgrav.Ar module-path
156ce77a8d6SDag-Erling Smørgravfield specifies the name or full path of the module to call.
157ce77a8d6SDag-Erling SmørgravIf only the name is specified, the PAM library will search for it in
158ce77a8d6SDag-Erling Smørgravthe following locations:
159ce77a8d6SDag-Erling Smørgrav.Bl -enum
160ce77a8d6SDag-Erling Smørgrav.It
161ce77a8d6SDag-Erling Smørgrav.Pa /usr/lib
162ce77a8d6SDag-Erling Smørgrav.It
163ce77a8d6SDag-Erling Smørgrav.Pa /usr/local/lib
164ce77a8d6SDag-Erling Smørgrav.El
165556dce83SDag-Erling Smørgrav.Pp
166ce77a8d6SDag-Erling SmørgravThe remaining fields, if any, are passed unmodified to the module if
167ce77a8d6SDag-Erling Smørgravand when it is invoked.
168556dce83SDag-Erling Smørgrav.Pp
169556dce83SDag-Erling SmørgravThe
170556dce83SDag-Erling Smørgrav.Cm include
171556dce83SDag-Erling Smørgravform of entry causes entries from a different chain (specified by
172556dce83SDag-Erling Smørgrav.Ar other-system-name )
173556dce83SDag-Erling Smørgravto be included in the current one.
174556dce83SDag-Erling SmørgravThis allows one to define system-wide policies which are then included
175556dce83SDag-Erling Smørgravinto service-specific policies.
176556dce83SDag-Erling SmørgravThe system-wide policy can then be modified without having to also
177556dce83SDag-Erling Smørgravmodify each and every service-specific policy.
178ce77a8d6SDag-Erling Smørgrav.Pp
179ce77a8d6SDag-Erling Smørgrav.Bf -symbolic
180ce77a8d6SDag-Erling SmørgravTake care not to introduce loops when using
181ce77a8d6SDag-Erling Smørgrav.Cm include
182ce77a8d6SDag-Erling Smørgravrules, as there is currently no loop detection in place.
183ce77a8d6SDag-Erling Smørgrav.Ef
184ce77a8d6SDag-Erling Smørgrav.Sh MODULE OPTIONS
185ce77a8d6SDag-Erling SmørgravSome PAM library functions may alter their behavior when called by a
186ce77a8d6SDag-Erling Smørgravservice module if certain module options were specified, regardless of
187ce77a8d6SDag-Erling Smørgravwhether the module itself accords them any importance.
188ce77a8d6SDag-Erling SmørgravOne such option is
189ce77a8d6SDag-Erling Smørgrav.Cm debug ,
190ce77a8d6SDag-Erling Smørgravwhich causes the dispatcher to enable debugging messages before
191ce77a8d6SDag-Erling Smørgravcalling each service function, and disable them afterwards (unless
192ce77a8d6SDag-Erling Smørgravthey were already enabled).
193ce77a8d6SDag-Erling SmørgravOther special options include:
194ce77a8d6SDag-Erling Smørgrav.Bl -tag -width 12n
195ce77a8d6SDag-Erling Smørgrav.It Cm authtok_prompt Ns = Ns Ar prompt , Cm oldauthtok_prompt Ns = Ns Ar prompt , Cm user_prompt Ns = Ns Ar prompt
196ce77a8d6SDag-Erling SmørgravThese options can be used to override the prompts used by
197ce77a8d6SDag-Erling Smørgrav.Xr pam_get_authtok 3
198ce77a8d6SDag-Erling Smørgravand
199ce77a8d6SDag-Erling Smørgrav.Xr pam_get_user 3 .
200ce77a8d6SDag-Erling Smørgrav.It Cm echo_pass
201ce77a8d6SDag-Erling SmørgravThis option controls whether
202ce77a8d6SDag-Erling Smørgrav.Xr pam_get_authtok 3
203ce77a8d6SDag-Erling Smørgravwill allow the user to see what they are typing.
204ce77a8d6SDag-Erling Smørgrav.It Cm try_first_pass , Cm use_first_pass
205ce77a8d6SDag-Erling SmørgravThese options control
206ce77a8d6SDag-Erling Smørgrav.Xr pam_get_authtok 3 Ns 's
207ce77a8d6SDag-Erling Smørgravuse of cached authentication tokens.
208ce77a8d6SDag-Erling Smørgrav.El
209556dce83SDag-Erling Smørgrav.Sh SEE ALSO
210556dce83SDag-Erling Smørgrav.Xr pam 3
211556dce83SDag-Erling Smørgrav.Sh STANDARDS
212556dce83SDag-Erling Smørgrav.Rs
213556dce83SDag-Erling Smørgrav.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
214556dce83SDag-Erling Smørgrav.%D "June 1997"
215556dce83SDag-Erling Smørgrav.Re
216556dce83SDag-Erling Smørgrav.Sh AUTHORS
21705640c12SDag-Erling SmørgravThe OpenPAM library was developed for the
21805640c12SDag-Erling Smørgrav.Fx
2197f106882SDag-Erling SmørgravProject by ThinkSec AS and Network Associates Laboratories, the
2207f106882SDag-Erling SmørgravSecurity Research Division of Network Associates, Inc.\& under
2217f106882SDag-Erling SmørgravDARPA/SPAWAR contract N66001-01-C-8035
222556dce83SDag-Erling Smørgrav.Pq Dq CBOSS ,
223556dce83SDag-Erling Smørgravas part of the DARPA CHATS research program.
224556dce83SDag-Erling Smørgrav.Pp
2252f3ed619SDag-Erling SmørgravThe OpenPAM library is maintained by
226*45538173SDag-Erling Smørgrav.An Dag-Erling Sm\(/orgrav Aq Mt des@des.dev .
227