source: postlfs/security/shadow.xml@ 4fcf20a5

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 4fcf20a5 was 4fcf20a5, checked in by Randy McMurchy <randy@…>, 19 years ago

Updated to Shadow-4.0.7

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

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