Import Linux-PAM.
[profile/ivi/pam.git] / modules / pam_pwhistory / pam_pwhistory.8
1 .\"     Title: pam_pwhistory
2 .\"    Author: [see the "AUTHOR" section]
3 .\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
4 .\"      Date: 06/21/2011
5 .\"    Manual: Linux-PAM Manual
6 .\"    Source: Linux-PAM Manual
7 .\"  Language: English
8 .\"
9 .TH "PAM_PWHISTORY" "8" "06/21/2011" "Linux-PAM Manual" "Linux\-PAM Manual"
10 .\" -----------------------------------------------------------------
11 .\" * (re)Define some macros
12 .\" -----------------------------------------------------------------
13 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 .\" toupper - uppercase a string (locale-aware)
15 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 .de toupper
17 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
18 \\$*
19 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
20 ..
21 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 .\" SH-xref - format a cross-reference to an SH section
23 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 .de SH-xref
25 .ie n \{\
26 .\}
27 .toupper \\$*
28 .el \{\
29 \\$*
30 .\}
31 ..
32 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 .\" SH - level-one heading that works better for non-TTY output
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .de1 SH
36 .\" put an extra blank line of space above the head in non-TTY output
37 .if t \{\
38 .sp 1
39 .\}
40 .sp \\n[PD]u
41 .nr an-level 1
42 .set-an-margin
43 .nr an-prevailing-indent \\n[IN]
44 .fi
45 .in \\n[an-margin]u
46 .ti 0
47 .HTML-TAG ".NH \\n[an-level]"
48 .it 1 an-trap
49 .nr an-no-space-flag 1
50 .nr an-break-flag 1
51 \." make the size of the head bigger
52 .ps +3
53 .ft B
54 .ne (2v + 1u)
55 .ie n \{\
56 .\" if n (TTY output), use uppercase
57 .toupper \\$*
58 .\}
59 .el \{\
60 .nr an-break-flag 0
61 .\" if not n (not TTY), use normal case (not uppercase)
62 \\$1
63 .in \\n[an-margin]u
64 .ti 0
65 .\" if not n (not TTY), put a border/line under subheading
66 .sp -.6
67 \l'\n(.lu'
68 .\}
69 ..
70 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 .\" SS - level-two heading that works better for non-TTY output
72 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 .de1 SS
74 .sp \\n[PD]u
75 .nr an-level 1
76 .set-an-margin
77 .nr an-prevailing-indent \\n[IN]
78 .fi
79 .in \\n[IN]u
80 .ti \\n[SN]u
81 .it 1 an-trap
82 .nr an-no-space-flag 1
83 .nr an-break-flag 1
84 .ps \\n[PS-SS]u
85 \." make the size of the head bigger
86 .ps +2
87 .ft B
88 .ne (2v + 1u)
89 .if \\n[.$] \&\\$*
90 ..
91 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 .\" BB/BE - put background/screen (filled box) around block of text
93 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94 .de BB
95 .if t \{\
96 .sp -.5
97 .br
98 .in +2n
99 .ll -2n
100 .gcolor red
101 .di BX
102 .\}
103 ..
104 .de EB
105 .if t \{\
106 .if "\\$2"adjust-for-leading-newline" \{\
107 .sp -1
108 .\}
109 .br
110 .di
111 .in
112 .ll
113 .gcolor
114 .nr BW \\n(.lu-\\n(.i
115 .nr BH \\n(dn+.5v
116 .ne \\n(BHu+.5v
117 .ie "\\$2"adjust-for-leading-newline" \{\
118 \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
119 .\}
120 .el \{\
121 \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
122 .\}
123 .in 0
124 .sp -.5v
125 .nf
126 .BX
127 .in
128 .sp .5v
129 .fi
130 .\}
131 ..
132 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 .\" BM/EM - put colored marker in margin next to block of text
134 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135 .de BM
136 .if t \{\
137 .br
138 .ll -2n
139 .gcolor red
140 .di BX
141 .\}
142 ..
143 .de EM
144 .if t \{\
145 .br
146 .di
147 .ll
148 .gcolor
149 .nr BH \\n(dn
150 .ne \\n(BHu
151 \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
152 .in 0
153 .nf
154 .BX
155 .in
156 .fi
157 .\}
158 ..
159 .\" -----------------------------------------------------------------
160 .\" * set default formatting
161 .\" -----------------------------------------------------------------
162 .\" disable hyphenation
163 .nh
164 .\" disable justification (adjust text to left margin only)
165 .ad l
166 .\" -----------------------------------------------------------------
167 .\" * MAIN CONTENT STARTS HERE *
168 .\" -----------------------------------------------------------------
169 .SH "Name"
170 pam_pwhistory \- PAM module to remember last passwords
171 .SH "Synopsis"
172 .fam C
173 .HP \w'\fBpam_pwhistory\&.so\fR\ 'u
174 \fBpam_pwhistory\&.so\fR [debug] [use_authtok] [enforce_for_root] [remember=\fIN\fR] [retry=\fIN\fR] [authtok_type=\fISTRING\fR]
175 .fam
176 .SH "DESCRIPTION"
177 .PP
178 This module saves the last passwords for each user in order to force password change history and keep the user from alternating between the same password too frequently\&.
179 .PP
180 This module does not work together with kerberos\&. In general, it does not make much sense to use this module in conjunction with NIS or LDAP, since the old passwords are stored on the local machine and are not available on another machine for password history checking\&.
181 .SH "OPTIONS"
182 .PP
183 \fBdebug\fR
184 .RS 4
185 Turns on debugging via
186 \fBsyslog\fR(3)\&.
187 .RE
188 .PP
189 \fBuse_authtok\fR
190 .RS 4
191 When password changing enforce the module to use the new password provided by a previously stacked
192 \fBpassword\fR
193 module (this is used in the example of the stacking of the
194 \fBpam_cracklib\fR
195 module documented below)\&.
196 .RE
197 .PP
198 \fBenforce_for_root\fR
199 .RS 4
200 If this option is set, the check is enforced for root, too\&.
201 .RE
202 .PP
203 \fBremember=\fR\fB\fIN\fR\fR
204 .RS 4
205 The last
206 \fIN\fR
207 passwords for each user are saved in
208 \FC/etc/security/opasswd\F[]\&. The default is
209 \fI10\fR\&. Value of
210 \fI0\fR
211 makes the module to keep the existing contents of the
212 \FCopasswd\F[]
213 file unchanged\&.
214 .RE
215 .PP
216 \fBretry=\fR\fB\fIN\fR\fR
217 .RS 4
218 Prompt user at most
219 \fIN\fR
220 times before returning with error\&. The default is
221 \fI1\fR\&.
222 .RE
223 .PP
224 \fBauthtok_type=\fR\fB\fISTRING\fR\fR
225 .RS 4
226 See
227 \fBpam_get_authtok\fR(3)
228 for more details\&.
229 .RE
230 .SH "MODULE TYPES PROVIDED"
231 .PP
232 Only the
233 \fBpassword\fR
234 module type is provided\&.
235 .SH "RETURN VALUES"
236 .PP
237 PAM_AUTHTOK_ERR
238 .RS 4
239 No new password was entered, the user aborted password change or new password couldn\'t be set\&.
240 .RE
241 .PP
242 PAM_IGNORE
243 .RS 4
244 Password history was disabled\&.
245 .RE
246 .PP
247 PAM_MAXTRIES
248 .RS 4
249 Password was rejected too often\&.
250 .RE
251 .PP
252 PAM_USER_UNKNOWN
253 .RS 4
254 User is not known to system\&.
255 .RE
256 .SH "EXAMPLES"
257 .PP
258 An example password section would be:
259 .sp
260 .if n \{\
261 .RS 4
262 .\}
263 .fam C
264 .ps -1
265 .nf
266 .if t \{\
267 .sp -1
268 .\}
269 .BB lightgray adjust-for-leading-newline
270 .sp -1
271
272 #%PAM\-1\&.0
273 password     required       pam_pwhistory\&.so
274 password     required       pam_unix\&.so        use_authtok
275       
276 .EB lightgray adjust-for-leading-newline
277 .if t \{\
278 .sp 1
279 .\}
280 .fi
281 .fam
282 .ps +1
283 .if n \{\
284 .RE
285 .\}
286 .PP
287 In combination with
288 \fBpam_cracklib\fR:
289 .sp
290 .if n \{\
291 .RS 4
292 .\}
293 .fam C
294 .ps -1
295 .nf
296 .if t \{\
297 .sp -1
298 .\}
299 .BB lightgray adjust-for-leading-newline
300 .sp -1
301
302 #%PAM\-1\&.0
303 password     required       pam_cracklib\&.so    retry=3
304 password     required       pam_pwhistory\&.so   use_authtok
305 password     required       pam_unix\&.so        use_authtok
306       
307 .EB lightgray adjust-for-leading-newline
308 .if t \{\
309 .sp 1
310 .\}
311 .fi
312 .fam
313 .ps +1
314 .if n \{\
315 .RE
316 .\}
317 .sp
318 .SH "FILES"
319 .PP
320 \FC/etc/security/opasswd\F[]
321 .RS 4
322 File with password history
323 .RE
324 .SH "SEE ALSO"
325 .PP
326
327 \fBpam.conf\fR(5),
328 \fBpam.d\fR(5),
329 \fBpam\fR(8)
330 \fBpam_get_authtok\fR(3)
331 .SH "AUTHOR"
332 .PP
333 pam_pwhistory was written by Thorsten Kukuk <kukuk@thkukuk\&.de>