source: postlfs/security/shadow.xml@ bfb7882

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since bfb7882 was 974951c, checked in by Randy McMurchy <randy@…>, 19 years ago

Fixed typos in the Shadow instructions

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4794 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 13.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY shadow-download-http " ">
8 <!ENTITY shadow-download-ftp "ftp://ftp.pld.org.pl/software/shadow/old/shadow-&shadow-version;.tar.bz2">
9 <!ENTITY shadow-md5sum "66e3a3a60ea6b021a7babff311b07607">
10 <!ENTITY shadow-size "1.1 MB">
11 <!ENTITY shadow-buildsize "13 MB">
12 <!ENTITY shadow-time "0.3 SBU">
13]>
14
15<sect1 id="shadow" xreflabel="Shadow-&shadow-version;">
16 <?dbhtml filename="shadow.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Shadow-&shadow-version;</title>
24
25 <indexterm zone="shadow">
26 <primary sortas="a-Shadow">Shadow</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Shadow</title>
31
32 <para><application>Shadow</application> was indeed installed in LFS and
33 there is no reason to reinstall it unless you installed
34 <application>Linux-PAM</application>. If you did, this will allow programs
35 like <command>login</command> and <command>su</command> to utilize PAM.</para>
36
37 <bridgehead renderas="sect3">Package Information</bridgehead>
38 <itemizedlist spacing="compact">
39 <listitem>
40 <para>Download (HTTP): <ulink url="&shadow-download-http;"/></para>
41 </listitem>
42 <listitem>
43 <para>Download (FTP): <ulink url="&shadow-download-ftp;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download MD5 sum: &shadow-md5sum;</para>
47 </listitem>
48 <listitem>
49 <para>Download size: &shadow-size;</para>
50 </listitem>
51 <listitem>
52 <para>Estimated disk space required: &shadow-buildsize;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated build time: &shadow-time;</para>
56 </listitem>
57 </itemizedlist>
58
59 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
60 <itemizedlist spacing='compact'>
61 <listitem>
62 <para>Patch to fix several invalid warning messages when used with
63 <application>Linux_PAM</application>: <ulink
64 url="&patch-root;/shadow-&shadow-version;-Linux_PAM_fixes-1.patch"/></para>
65 </listitem>
66 </itemizedlist>
67
68 <bridgehead renderas="sect3">Shadow Dependencies</bridgehead>
69
70 <bridgehead renderas="sect4">Required</bridgehead>
71 <para><xref linkend="Linux_PAM"/></para>
72
73 </sect2>
74
75 <sect2 role="installation">
76 <title>Installation of Shadow</title>
77
78 <para>Reinstall <application>Shadow</application> by running the following
79 commands:</para>
80
81<screen><userinput>patch -Np1 -i ../shadow-&shadow-version;-Linux_PAM_fixes-1.patch &amp;&amp;
82./configure --libdir=/lib --enable-shared \
83 --with-libpam --without-libcrack &amp;&amp;
84sed -i 's/groups$(EXEEXT) //' src/Makefile &amp;&amp;
85sed -i '/groups/d' man/Makefile &amp;&amp;
86make</userinput></screen>
87
88 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
89
90<screen role="root"><userinput>make install &amp;&amp;
91mv -v /usr/bin/passwd /bin &amp;&amp;
92mv -v /lib/libshadow.*a /usr/lib &amp;&amp;
93rm -v /lib/libshadow.so &amp;&amp;
94ln -v -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
95
96 </sect2>
97
98 <sect2 role="commands">
99 <title>Command Explanations</title>
100
101 <para><parameter>--without-libcrack</parameter>: This switch tells
102 <application>Shadow</application> not to use
103 <filename class='libraryfile'>libcrack</filename>. This is desired as
104 <application>Linux-PAM</application> already contains
105 <filename class='libraryfile'>libcrack</filename>.</para>
106
107 <para><command>sed -i ...</command>: These commands are used to suppress
108 the installation of the <command>groups</command> program as the version
109 from the <application>Coreutils</application> package installed during
110 LFS is preferred.</para>
111
112 </sect2>
113
114 <sect2 role="configuration">
115 <title>Configuring Linux-PAM to Work with Shadow</title>
116
117 <sect3 id="pam.d">
118 <title>Config Files</title>
119
120 <para><filename>/etc/pam.d/*</filename>, or alternatively,
121 <filename>/etc/pam.conf</filename></para>
122
123 <indexterm zone="shadow pam.d">
124 <primary sortas="e-etc-pam.d">/etc/pam.d/*</primary>
125 </indexterm>
126
127 <indexterm zone="shadow pam.d">
128 <primary sortas="e-etc-pam.conf">/etc/pam.conf</primary>
129 </indexterm>
130
131 </sect3>
132
133 <sect3>
134 <title>Configuration Information</title>
135
136 <para>Add the following <application>Linux-PAM</application> configuration
137 files to <filename class="directory">/etc/pam.d/</filename> (or add them
138 to <filename>/etc/pam.conf</filename> with the additional field for
139 the program).</para>
140
141 <sect4>
142 <title>'login' (with CrackLib)</title>
143
144<screen role="root"><userinput>cat &gt; /etc/pam.d/login &lt;&lt; "EOF"
145<literal># Begin /etc/pam.d/login
146
147auth requisite pam_securetty.so
148auth requisite pam_nologin.so
149auth required pam_env.so
150auth required pam_unix.so
151account required pam_access.so
152account required pam_unix.so
153session required pam_motd.so
154session required pam_limits.so
155session optional pam_mail.so dir=/var/mail standard
156session optional pam_lastlog.so
157session required pam_unix.so
158password required pam_cracklib.so retry=3 difok=8 minlen=5 \
159 dcredit=3 ocredit=3 \
160 ucredit=2 lcredit=2
161password required pam_unix.so md5 shadow use_authtok
162
163# End /etc/pam.d/login</literal>
164EOF</userinput></screen>
165
166 </sect4>
167
168 <sect4>
169 <title>'login' (without CrackLib)</title>
170
171<screen role="root"><userinput>cat &gt; /etc/pam.d/login &lt;&lt; "EOF"
172<literal># Begin /etc/pam.d/login
173
174auth requisite pam_securetty.so
175auth requisite pam_nologin.so
176auth required pam_env.so
177auth required pam_unix.so
178account required pam_access.so
179account required pam_unix.so
180session required pam_motd.so
181session required pam_limits.so
182session optional pam_mail.so dir=/var/mail standard
183session optional pam_lastlog.so
184session required pam_unix.so
185password required pam_unix.so md5 shadow
186
187# End /etc/pam.d/login</literal>
188EOF</userinput></screen>
189
190 </sect4>
191
192 <sect4>
193 <title>'passwd' (with CrackLib)</title>
194
195<screen role="root"><userinput>cat &gt; /etc/pam.d/passwd &lt;&lt; "EOF"
196<literal># Begin /etc/pam.d/passwd
197
198password required pam_cracklib.so retry=3 difok=8 minlen=5 \
199 dcredit=3 ocredit=3 \
200 ucredit=2 lcredit=2
201password required pam_unix.so md5 shadow use_authtok
202
203# End /etc/pam.d/passwd</literal>
204EOF</userinput></screen>
205
206 </sect4>
207
208 <sect4>
209 <title>'passwd' (without CrackLib)</title>
210
211<screen role="root"><userinput>cat &gt; /etc/pam.d/passwd &lt;&lt; "EOF"
212<literal># Begin /etc/pam.d/passwd
213
214password required pam_unix.so md5 shadow
215
216# End /etc/pam.d/passwd</literal>
217EOF</userinput></screen>
218
219 </sect4>
220
221 <sect4>
222 <title>'su'</title>
223
224<screen role="root"><userinput>cat &gt; /etc/pam.d/su &lt;&lt; "EOF"
225<literal># Begin /etc/pam.d/su
226
227auth sufficient pam_rootok.so
228auth required pam_unix.so
229account required pam_unix.so
230session optional pam_mail.so dir=/var/mail standard
231session required pam_unix.so
232
233# End /etc/pam.d/su</literal>
234EOF</userinput></screen>
235
236 </sect4>
237
238 <sect4>
239 <title>'chage'</title>
240
241<screen role="root"><userinput>cat &gt; /etc/pam.d/chage &lt;&lt; "EOF"
242<literal># Begin /etc/pam.d/chage
243
244auth sufficient pam_rootok.so
245auth required pam_unix.so
246account required pam_unix.so
247session required pam_unix.so
248password required pam_permit.so
249
250# End /etc/pam.d/chage</literal>
251EOF</userinput></screen>
252
253 </sect4>
254
255 <sect4>
256 <title>'chpasswd', 'newusers', 'groupadd', 'groupdel',
257 'groupmod', 'useradd', 'userdel', and 'usermod'</title>
258
259<screen role="root"><userinput>for PROGRAM in chpasswd newusers groupadd groupdel \
260 groupmod useradd userdel usermod
261do
262 install -v -m644 /etc/pam.d/chage /etc/pam.d/$PROGRAM
263 sed -i -e "s/chage/$PROGRAM/" /etc/pam.d/$PROGRAM
264done</userinput></screen>
265
266 <warning>
267 <para>At this point, you should do a simple test to see if
268 <application>Shadow</application> is working as expected. Open
269 another term and log in as a user, then <command>su</command> to
270 <systemitem class="username">root</systemitem>. If you do not see any
271 errors, then all is well and you should proceed with the rest of the
272 configuration. If you did receive errors, stop now and double check
273 the above configuration files manually. If you cannot find and
274 fix the error, you should recompile <application>Shadow</application>
275 replacing <option>--with-libpam</option> with
276 <option>--without-libpam</option> in the above instructions. If you
277 fail to do this and the errors remain, you will be unable to log into
278 your system.</para>
279 </warning>
280
281 </sect4>
282
283 <sect4>
284 <title>Other</title>
285
286 <para>Currently, <filename>/etc/pam.d/other</filename> is configured
287 to allow anyone with an account on the machine to use PAM-aware
288 programs without a configuration file for that program. After testing
289 <application>Linux-PAM</application> for proper configuration, install
290 a more restrictive <filename>other</filename> file so that
291 program-specific configuration files are required:</para>
292
293<screen role="root"><userinput>cat &gt; /etc/pam.d/other &lt;&lt; "EOF"
294<literal># Begin /etc/pam.d/other
295
296auth required pam_deny.so
297auth required pam_warn.so
298account required pam_deny.so
299session required pam_deny.so
300password required pam_deny.so
301password required pam_warn.so
302
303# End /etc/pam.d/other</literal>
304EOF</userinput></screen>
305
306 </sect4>
307
308 <sect4 id="pam-access">
309 <title>Configuring Login Access</title>
310
311 <para>Instead of using the <filename>/etc/login.access</filename>
312 file for controlling access to the system,
313 <application>Linux-PAM</application> uses the
314 <filename class='libraryfile'>pam_access.so</filename> module along
315 with the <filename>/etc/security/access.conf</filename> file. Rename
316 the <filename>/etc/login.access</filename> file using the following
317 command:</para>
318
319 <indexterm zone="shadow pam-access">
320 <primary sortas="e-etc-security-access.conf">/etc/security/access.conf</primary>
321 </indexterm>
322
323<screen role="root"><userinput>if [ -f /etc/login.access ]; then
324 mv -v /etc/login.access /etc/login.access.NOUSE
325fi</userinput></screen>
326
327 </sect4>
328
329 <sect4 id="pam-limits">
330 <title>Configuring Resource Limits</title>
331
332 <para>Instead of using the <filename>/etc/limits</filename> file
333 for limiting usage of system resources,
334 <application>Linux-PAM</application> uses the
335 <filename class='libraryfile'>pam_limits.so</filename> module along
336 with the <filename>/etc/security/limits.conf</filename> file. Rename
337 the <filename>/etc/limits</filename> file using the following
338 command:</para>
339
340 <indexterm zone="shadow pam-limits">
341 <primary sortas="e-etc-security-limits.conf">/etc/security/limits.conf</primary>
342 </indexterm>
343
344<screen role="root"><userinput>if [ -f /etc/limits ]; then
345 mv -v /etc/limits /etc/limits.NOUSE
346fi</userinput></screen>
347
348 </sect4>
349
350 <sect4 id="pam-login-defs">
351 <title>Configuring /etc/login.defs</title>
352
353 <para>The <command>login</command> program currently performs many
354 functions which <application>Linux-PAM</application> modules should
355 now handle. The following command will comment out the appropriate
356 lines in <filename>/etc/login.defs</filename>, and stop
357 <command>login</command> from performing these functions:</para>
358
359 <indexterm zone="shadow pam-login-defs">
360 <primary sortas="e-etc-login.defs">/etc/login.defs</primary>
361 </indexterm>
362
363<screen role="root"><userinput>for FUNCTION in LASTLOG_ENAB MAIL_CHECK_ENAB \
364 PORTTIME_CHECKS_ENAB CONSOLE \
365 MOTD_FILE NOLOGINS_FILE PASS_MIN_LEN \
366 SU_WHEEL_ONLY MD5_CRYPT_ENAB \
367 CONSOLE_GROUPS ENVIRON_FILE \
368 ULIMIT ENV_TZ ENV_HZ ENV_SUPATH \
369 ENV_PATH QMAIL_DIR MAIL_DIR MAIL_FILE \
370 CHFN_AUTH FAILLOG_ENAB QUOTAS_ENAB FTMP_FILE
371do
372 sed -i -e "s/^$FUNCTION/# &amp;/" /etc/login.defs
373done</userinput></screen>
374
375 <para>If you have <application>CrackLib</application> installed,
376 also comment out four more lines using the following command:</para>
377
378<screen role="root"><userinput>for FUNCTION in OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
379 PASS_CHANGE_TRIES PASS_ALWAYS_WARN
380do
381 sed -i -e "s/^$FUNCTION/# &amp;/" /etc/login.defs
382done</userinput></screen>
383
384 </sect4>
385
386 </sect3>
387
388 </sect2>
389
390 <sect2 role="content">
391 <title>Contents</title>
392
393 <para>A list of the installed files, along with their short descriptions
394 can be found at
395 <ulink url="&lfs-root;/chapter06/shadow.html#contents-shadow"/>.</para>
396
397 </sect2>
398
399</sect1>
Note: See TracBrowser for help on using the repository browser.