source: postlfs/security/linux-pam.xml@ ae6e927

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since ae6e927 was 2314cd7, checked in by Thomas Trepl <thomas@…>, 11 months ago

Some tags

  • Property mode set to 100644
File size: 18.3 KB
RevLine 
[b4b71892]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[b4b71892]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[7eaa8018]7 <!ENTITY linux-pam-download-http "https://github.com/linux-pam/linux-pam/releases/download/v&linux-pam-version;/Linux-PAM-&linux-pam-version;.tar.xz">
[1ae6204]8 <!ENTITY linux-pam-download-ftp " ">
[516e46e3]9 <!ENTITY linux-pam-md5sum "a913bd5fbf9edeafaacf3eb1eb86fd83">
10 <!ENTITY linux-pam-size "967 KB">
[d732663]11 <!ENTITY linux-pam-buildsize "39 MB (with tests)">
[10bfa7e0]12 <!ENTITY linux-pam-time "0.4 SBU (with tests)">
[7eaa8018]13
[c246bfab]14 <!ENTITY linux-pam-docs-download "https://github.com/linux-pam/linux-pam/releases/download/v&linux-pam-version;/Linux-PAM-&linux-pam-docs-version;-docs.tar.xz">
[516e46e3]15 <!ENTITY linux-pam-docs-md5sum "c3771fdc447be78b4c1756b875235965">
16 <!ENTITY linux-pam-docs-size "456 KB">
[7eaa8018]17 <!--
[1ae6204]18 <!ENTITY debian-pam-docs "http://debian.securedservers.com/kernel/pub/linux/libs/pam">
[7eaa8018]19 -->
[b4b71892]20]>
21
[6603f8b]22<sect1 id="linux-pam" xreflabel="Linux-PAM-&linux-pam-version;">
23 <?dbhtml filename="linux-pam.html"?>
[c7eb655]24
25
[6603f8b]26 <title>Linux-PAM-&linux-pam-version;</title>
[c7eb655]27
[6603f8b]28 <indexterm zone="linux-pam">
29 <primary sortas="a-Linux-PAM">Linux-PAM</primary>
[c7eb655]30 </indexterm>
31
32 <sect2 role="package">
[db248d06]33 <title>Introduction to Linux PAM</title>
[c7eb655]34
[db248d06]35 <para>
36 The <application>Linux PAM</application> package contains
[7f70be6]37 Pluggable Authentication Modules used by the local
38 system administrator to control how application programs authenticate
[db248d06]39 users.
40 </para>
[c7eb655]41
[2314cd7]42 &lfs120_checked;
[f4797d2]43
[c7eb655]44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
[db248d06]47 <para>
48 Download (HTTP): <ulink url="&linux-pam-download-http;"/>
49 </para>
[c7eb655]50 </listitem>
51 <listitem>
[db248d06]52 <para>
53 Download (FTP): <ulink url="&linux-pam-download-ftp;"/>
54 </para>
[c7eb655]55 </listitem>
56 <listitem>
[db248d06]57 <para>
58 Download MD5 sum: &linux-pam-md5sum;
59 </para>
[c7eb655]60 </listitem>
61 <listitem>
[db248d06]62 <para>
63 Download size: &linux-pam-size;
64 </para>
[c7eb655]65 </listitem>
66 <listitem>
[db248d06]67 <para>
68 Estimated disk space required: &linux-pam-buildsize;
69 </para>
[c7eb655]70 </listitem>
71 <listitem>
[db248d06]72 <para>
73 Estimated build time: &linux-pam-time;
74 </para>
[c7eb655]75 </listitem>
76 </itemizedlist>
77
78 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
[db248d06]79 <itemizedlist spacing="compact">
[07f0c976]80 <title>Optional Documentation</title>
[c7eb655]81 <listitem>
[db248d06]82 <para>
83 Download (HTTP): <ulink url="&linux-pam-docs-download;"/>
84 </para>
[903f671]85 </listitem>
86 <listitem>
[db248d06]87 <para>
88 Download MD5 sum: &linux-pam-docs-md5sum;
89 </para>
[903f671]90 </listitem>
91 <listitem>
[db248d06]92 <para>
93 Download size &linux-pam-docs-size;
94 </para>
[6576f3e]95 </listitem>
96 </itemizedlist>
97
[db248d06]98 <bridgehead renderas="sect3">Linux PAM Dependencies</bridgehead>
[c7eb655]99
100 <bridgehead renderas="sect4">Optional</bridgehead>
[db248d06]101 <para role="optional">
102 <xref linkend="db"/>,
[7e11b83c]103 <xref linkend="libnsl"/>,
[8558044]104 <xref linkend="libtirpc"/>,
[7e11b83c]105 <ulink url="https://github.com/linux-audit/audit-userspace">libaudit</ulink>, and
[cd29bc9]106 <ulink url="https://www.prelude-siem.org">Prelude</ulink>
[db248d06]107 </para>
[f8dd4ec]108<!-- With 1.5.3, building the doc requires the namespaced version of
109 docbook-xsl, which is beyond BLFS.
[db248d06]110
111 <bridgehead renderas="sect4">Optional (To Rebuild the Documentation)</bridgehead>
112 <para role="optional">
113 <xref linkend="DocBook"/>,
114 <xref linkend="docbook-xsl"/>,
115 <xref linkend="fop"/>,
[5ffb9f5]116 <xref linkend="libxslt"/> and either
[1eac9eb]117 <xref linkend="lynx"/> or
118 <ulink url="&w3m-url;">W3m</ulink>
[db248d06]119 </para>
[f8dd4ec]120-->
[58dfbe3]121 <note>
122 <para role="required">
123 <xref role="runtime" linkend="shadow"/>
124 <phrase revision="systemd"> and <xref role="runtime" linkend="systemd"/>
[7f70be6]125 must</phrase><phrase revision="sysv">must</phrase> be reinstalled
126 and reconfigured
[58dfbe3]127 after installing and configuring <application>Linux PAM</application>.
128 </para>
[19d6c39]129
130 <para role="recommended">
131 With Linux-PAM-1.4.0 and higher, the pam_cracklib module is not
[7f70be6]132 installed by default. Use <xref role="runtime" linkend="libpwquality"/>
133 to enforce strong passwords.
[19d6c39]134 </para>
[58dfbe3]135 </note>
136
[c7eb655]137 </sect2>
138
139 <sect2 role="installation">
[db248d06]140 <title>Installation of Linux PAM</title>
[c7eb655]141
[ad539dbe]142 <para revision="sysv">
[7f70be6]143 First, prevent the installation of an unneeded systemd file:
[ad539dbe]144 </para>
145
146<screen revision="sysv"><userinput>sed -e /service_DATA/d \
147 -i modules/pam_namespace/Makefile.am &amp;&amp;
148autoreconf</userinput></screen>
149
[db248d06]150 <para>
151 If you downloaded the documentation, unpack the tarball by issuing
152 the following command.
153 </para>
[903f671]154
[f330e62]155<screen><userinput>tar -xf ../Linux-PAM-&linux-pam-docs-version;-docs.tar.xz --strip-components=1</userinput></screen>
[f8dd4ec]156<!--
[1eac9eb]157 <para>
[7f70be6]158 If you want to regenerate the documentation yourself, fix the
159 <command>configure</command> script so it will detect lynx:
[1eac9eb]160 </para>
161
[ad539dbe]162<screen><userinput>sed -e 's/dummy elinks/dummy lynx/' \
[1eac9eb]163 -e 's/-no-numbering -no-references/-force-html -nonumbers -stdin/' \
164 -i configure</userinput></screen>
[f8dd4ec]165-->
[db248d06]166 <para>
[7f70be6]167 Compile and link <application>Linux PAM</application> by
[db248d06]168 running the following commands:
169 </para>
[c7eb655]170
[2a77179]171<screen><userinput>./configure --prefix=/usr \
[bf1e213]172 --sbindir=/usr/sbin \
173 --sysconfdir=/etc \
174 --libdir=/usr/lib \
175 --enable-securedir=/usr/lib/security \
[7cadfea]176 --docdir=/usr/share/doc/Linux-PAM-&linux-pam-version; &amp;&amp;
[c7eb655]177make</userinput></screen>
[17fb537e]178
[db248d06]179 <para>
[5c6a906]180 To test the results, a suitable <filename>/etc/pam.d/other</filename>
181 configuration file must exist.
182 </para>
183
184 <caution>
[7f70be6]185 <title>Reinstallation or Upgrade of Linux PAM</title>
[5c6a906]186 <para>
187 If you have a system with Linux PAM installed and working, be careful
188 when modifying the files in
189 <filename class="directory">/etc/pam.d</filename>, since your system
190 may become totally unusable. If you want to run the tests, you do not
191 need to create another <filename>/etc/pam.d/other</filename> file. The
[7f70be6]192 existing file can be used for the tests.
[5c6a906]193 </para>
194
195 <para>
196 You should also be aware that <command>make install</command>
197 overwrites the configuration files in
198 <filename class="directory">/etc/security</filename> as well as
[7f70be6]199 <filename>/etc/environment</filename>. If you
[7f92f72]200 have modified those files, be sure to back them up.
[5c6a906]201 </para>
202 </caution>
203
204 <para>
[7f70be6]205 For a first-time installation, create a configuration file by issuing the
[5c6a906]206 following commands as the <systemitem class="username">root</systemitem>
207 user:
[db248d06]208 </para>
[903f671]209
210<screen role="root"><userinput>install -v -m755 -d /etc/pam.d &amp;&amp;
[c03a8bd]211
[903f671]212cat &gt; /etc/pam.d/other &lt;&lt; "EOF"
[51dfb3e]213<literal>auth required pam_deny.so
[903f671]214account required pam_deny.so
215password required pam_deny.so
[51dfb3e]216session required pam_deny.so</literal>
[903f671]217EOF</userinput></screen>
[1ad238d8]218
[db248d06]219 <para>
220 Now run the tests by issuing <command>make check</command>.
[7f70be6]221 Be sure the tests produced no errors before continuing the
222 installation. Note that the tests are very long.
223 Redirect the output to a log file, so you can inspect it thoroughly.
[db248d06]224 </para>
[903f671]225
[db248d06]226 <para>
[7f70be6]227 For a first-time installation, remove the configuration file
[5c6a906]228 created earlier by issuing the following command as the
[db248d06]229 <systemitem class="username">root</systemitem> user:
230 </para>
[903f671]231
[8d9c3ed]232<screen role="root"><userinput>rm -fv /etc/pam.d/other</userinput></screen>
[f691f2b]233
[db248d06]234 <para>
235 Now, as the <systemitem class="username">root</systemitem>
236 user:
237 </para>
[17fb537e]238
[c7eb655]239<screen role="root"><userinput>make install &amp;&amp;
[2a77179]240chmod -v 4755 /usr/sbin/unix_chkpwd</userinput></screen>
[5ae7a99]241
[c7eb655]242 </sect2>
[b4b71892]243
[c7eb655]244 <sect2 role="commands">
245 <title>Command Explanations</title>
[b4b71892]246
[db248d06]247 <para>
[2a77179]248 <parameter>--enable-securedir=/usr/lib/security</parameter>:
[e52afdd]249 This switch sets the installation location for the
[5ae7a99]250 <application>PAM</application> modules.
251 </para>
[caa9f5ba]252<!--
[5ffb9f5]253 <para>
[caa9f5ba]254 <option>- -disable-regenerate-docu</option> : If the needed dependencies
[1eac9eb]255 (<xref linkend="DocBook"/>, <xref linkend="docbook-xsl"/>, <xref
256 linkend="libxslt"/>, and <xref linkend="lynx"/> or <ulink
257 url="&w3m-url;">W3m</ulink>) are installed, the manual pages, and the
[7f70be6]258 html and text documentation files, are generated and installed.
[1eac9eb]259 Furthermore, if <xref linkend="fop"/> is installed, the PDF
260 documentation is generated and installed. Use this switch if you do not
261 want to rebuild the documentation.
[5ffb9f5]262 </para>
[caa9f5ba]263-->
[db248d06]264 <para>
[2a77179]265 <command>chmod -v 4755 /usr/sbin/unix_chkpwd</command>:
[54d58907]266 The setuid bit for the <command>unix_chkpwd</command> helper program must be
[7f70be6]267 turned on, so that non-<systemitem class="username">root</systemitem>
[db248d06]268 processes can access the shadow file.
269 </para>
270
[c7eb655]271 </sect2>
[b4b71892]272
[c7eb655]273 <sect2 role="configuration">
274 <title>Configuring Linux-PAM</title>
[b4b71892]275
[c7eb655]276 <sect3 id="pam-config">
[7f70be6]277 <title>Configuration Files</title>
[b4b71892]278
[db248d06]279 <para>
280 <filename>/etc/security/*</filename> and
281 <filename>/etc/pam.d/*</filename>
282 </para>
[b4b71892]283
[6603f8b]284 <indexterm zone="linux-pam pam-config">
[c7eb655]285 <primary sortas="e-etc-security">/etc/security/*</primary>
286 </indexterm>
[b4b71892]287
[6603f8b]288 <indexterm zone="linux-pam pam-config">
[c7eb655]289 <primary sortas="e-etc-pam.d">/etc/pam.d/*</primary>
290 </indexterm>
291
292 </sect3>
293
294 <sect3>
295 <title>Configuration Information</title>
296
[db248d06]297 <para>
298 Configuration information is placed in
299 <filename class="directory">/etc/pam.d/</filename>.
[7f70be6]300 Here is a sample file:
[db248d06]301 </para>
[c7eb655]302
303<screen><literal># Begin /etc/pam.d/other
[b4b71892]304
305auth required pam_unix.so nullok
306account required pam_unix.so
307session required pam_unix.so
308password required pam_unix.so nullok
309
[db248d06]310# End /etc/pam.d/other</literal></screen>
[b4b71892]311
[47274444]312 <para>
[7f70be6]313 Now create some generic configuration files. As the
[f43bcd7]314 <systemitem class="username">root</systemitem> user:
[47274444]315 </para>
[78b5501]316
[2ec7beca]317<screen role="root"><userinput>install -vdm755 /etc/pam.d &amp;&amp;
318cat &gt; /etc/pam.d/system-account &lt;&lt; "EOF" &amp;&amp;
[78b5501]319<literal># Begin /etc/pam.d/system-account
320
321account required pam_unix.so
322
323# End /etc/pam.d/system-account</literal>
324EOF
325
[2ec7beca]326cat &gt; /etc/pam.d/system-auth &lt;&lt; "EOF" &amp;&amp;
[78b5501]327<literal># Begin /etc/pam.d/system-auth
328
329auth required pam_unix.so
330
331# End /etc/pam.d/system-auth</literal>
332EOF
333
[48dbad5]334cat &gt; /etc/pam.d/system-session &lt;&lt; "EOF" &amp;&amp;
[78b5501]335<literal># Begin /etc/pam.d/system-session
336
337session required pam_unix.so
338
339# End /etc/pam.d/system-session</literal>
[7e11b83c]340EOF
[48dbad5]341
[7e11b83c]342cat &gt; /etc/pam.d/system-password &lt;&lt; "EOF"
343<literal># Begin /etc/pam.d/system-password
[78b5501]344
[c0464a8]345# use yescrypt hash for encryption, use shadow, and try to use any
346# previously defined authentication token (chosen password) set by any
347# prior module.
348password required pam_unix.so yescrypt shadow try_first_pass
[7e11b83c]349
350# End /etc/pam.d/system-password</literal>
351EOF
352</userinput></screen>
353
354 <para>
355 If you wish to enable strong password support, install
356 <xref linkend="libpwquality"/>, and follow the
[7f70be6]357 instructions on that page to configure the pam_pwquality
[7e11b83c]358 PAM module with strong password support.
359 </para>
360
[47274444]361 <para>
[7f70be6]362 Next, add a restrictive <filename>/etc/pam.d/other</filename>
[47274444]363 configuration file. With this file, programs that are PAM aware will
364 not run unless a configuration file specifically for that application
[7f70be6]365 exists.
[47274444]366 </para>
[74f20a1]367
368<screen role="root"><userinput>cat &gt; /etc/pam.d/other &lt;&lt; "EOF"
369<literal># Begin /etc/pam.d/other
370
371auth required pam_warn.so
372auth required pam_deny.so
373account required pam_warn.so
374account required pam_deny.so
375password required pam_warn.so
376password required pam_deny.so
377session required pam_warn.so
378session required pam_deny.so
379
380# End /etc/pam.d/other</literal>
[78b5501]381EOF</userinput></screen>
382
[db248d06]383 <para>
384 The <application>PAM</application> man page (<command>man
[7f70be6]385 pam</command>) provides a good starting point to learn
386 about the several fields, and allowable entries.
387 <!-- not accessible 2022-09-08 -->
388 <!-- it's available at a different address 2022-10-23-->
[cd29bc9]389 The
[7f70be6]390 <ulink url="https://www.docs4dev.com/docs/en/linux-pam/1.1.2/reference/Linux-PAM_SAG.html">
[47274444]391 Linux-PAM System Administrators' Guide
[7f70be6]392 </ulink> is recommended for additional information.
[db248d06]393 </para>
[47274444]394
[ccb8b2d]395 <important>
[db248d06]396 <para>
397 You should now reinstall the <xref linkend="shadow"/>
[e2453ed5]398 <phrase revision="sysv">package</phrase>
[f586237]399 <phrase revision="systemd"> and <xref linkend="systemd"/>
[ae2e9fd8]400 packages</phrase>.
[db248d06]401 </para>
[ccb8b2d]402 </important>
[db248d06]403
[c7eb655]404 </sect3>
[db248d06]405
[c7eb655]406 </sect2>
407
408 <sect2 role="content">
409 <title>Contents</title>
410
411 <segmentedlist>
[ccb8b2d]412 <segtitle>Installed Program</segtitle>
[c7eb655]413 <segtitle>Installed Libraries</segtitle>
414 <segtitle>Installed Directories</segtitle>
415
416 <seglistitem>
[db248d06]417 <seg>
[e52afdd]418 faillock, mkhomedir_helper, pam_namespace_helper,
419 pam_timestamp_check, pwhistory_helper, unix_chkpwd and
[db248d06]420 unix_update
421 </seg>
422 <seg>
423 libpam.so, libpamc.so and libpam_misc.so
424 </seg>
425 <seg>
426 /etc/security,
[d732663]427 /usr/lib/security,
[db248d06]428 /usr/include/security and
429 /usr/share/doc/Linux-PAM-&linux-pam-version;
430 </seg>
[c7eb655]431 </seglistitem>
432 </segmentedlist>
433
434 <variablelist>
435 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
436 <?dbfo list-presentation="list"?>
437 <?dbhtml list-presentation="table"?>
438
[7e11b83c]439 <varlistentry id="faillock">
440 <term><command>faillock</command></term>
441 <listitem>
442 <para>
[4c24eb0a]443 displays and modifies the authentication failure record files
[7e11b83c]444 </para>
445 <indexterm zone="linux-pam faillock">
446 <primary sortas="b-faillock">faillock</primary>
447 </indexterm>
448 </listitem>
449 </varlistentry>
450
[db248d06]451 <varlistentry id="mkhomedir_helper">
452 <term><command>mkhomedir_helper</command></term>
453 <listitem>
454 <para>
[4c24eb0a]455 is a helper binary that creates home directories
[db248d06]456 </para>
457 <indexterm zone="linux-pam mkhomedir_helper">
458 <primary sortas="b-mkhomedir_helper">mkhomedir_helper</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
[e52afdd]463 <varlistentry id="pam_namespace_helper">
464 <term><command>pam_namespace_helper</command></term>
465 <listitem>
466 <para>
467 is a helper program used to configure a private namespace for a
[4c24eb0a]468 user session
[e52afdd]469 </para>
470 <indexterm zone="linux-pam pam_namespace_helper">
471 <primary sortas="b-pam_namespace_helper">pam_namespace_helper</primary>
472 </indexterm>
473 </listitem>
474 </varlistentry>
475
476 <varlistentry id="pwhistory_helper">
477 <term><command>pwhistory_helper</command></term>
478 <listitem>
479 <para>
480 is a helper program that transfers password hashes from passwd or
[4c24eb0a]481 shadow to opasswd
[e52afdd]482 </para>
483 <indexterm zone="linux-pam pwhistory_helper">
484 <primary sortas="b-pwhistory_helper">pwhistory_helper</primary>
485 </indexterm>
486 </listitem>
487 </varlistentry>
[7e11b83c]488<!-- Removed with the removal of the pam_tally{,2} module
[c7eb655]489 <varlistentry id="pam_tally">
490 <term><command>pam_tally</command></term>
491 <listitem>
[db248d06]492 <para>
493 is used to interrogate and manipulate the login counter file.
494 </para>
[6603f8b]495 <indexterm zone="linux-pam pam_tally">
[c7eb655]496 <primary sortas="b-pam_tally">pam_tally</primary>
497 </indexterm>
498 </listitem>
499 </varlistentry>
500
[db248d06]501 <varlistentry id="pam_tally2">
502 <term><command>pam_tally2</command></term>
503 <listitem>
504 <para>
505 is used to interrogate and manipulate the login counter file, but
506 does not have some limitations that <command>pam_tally</command>
507 does.
508 </para>
509 <indexterm zone="linux-pam pam_tally2">
510 <primary sortas="b-pam_tally2">pam_tally2</primary>
511 </indexterm>
512 </listitem>
513 </varlistentry>
[7e11b83c]514-->
[db248d06]515
516 <varlistentry id="pam_timestamp_check">
517 <term><command>pam_timestamp_check</command></term>
518 <listitem>
519 <para>
520 is used to check if the default timestamp is valid
521 </para>
522 <indexterm zone="linux-pam pam_timestamp_check">
523 <primary sortas="b-pam_timestamp_check">pam_timestamp_check</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="unix_chkpwd">
529 <term><command>unix_chkpwd</command></term>
530 <listitem>
531 <para>
[4c24eb0a]532 is a helper binary that verifies the password of the current user
[db248d06]533 </para>
534 <indexterm zone="linux-pam unix_chkpwd">
535 <primary sortas="b-unix_chkpwd">unix_chkpwd</primary>
536 </indexterm>
537 </listitem>
538 </varlistentry>
539
540 <varlistentry id="unix_update">
541 <term><command>unix_update</command></term>
542 <listitem>
543 <para>
[4c24eb0a]544 is a helper binary that updates the password of a given user
[db248d06]545 </para>
546 <indexterm zone="linux-pam unix_update">
547 <primary sortas="b-unix_update">unix_update</primary>
548 </indexterm>
549 </listitem>
550 </varlistentry>
551
[c7eb655]552 <varlistentry id="libpam">
[db248d06]553 <term><filename class="libraryfile">libpam.so</filename></term>
[c7eb655]554 <listitem>
[db248d06]555 <para>
556 provides the interfaces between applications and the
[4c24eb0a]557 PAM modules
[db248d06]558 </para>
[6603f8b]559 <indexterm zone="linux-pam libpam">
[db248d06]560 <primary sortas="c-libpam">libpam.so</primary>
[c7eb655]561 </indexterm>
562 </listitem>
563 </varlistentry>
[db248d06]564
[c7eb655]565 </variablelist>
[db248d06]566
[c7eb655]567 </sect2>
[db248d06]568
[3c52f859]569</sect1>
Note: See TracBrowser for help on using the repository browser.