1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!-- <!ENTITY shadow-download-http "http://ftp.pld.org.pl/software/shadow/old/shadow-&shadow-version;.tar.bz2"> -->
|
---|
8 | <!ENTITY shadow-download-http "http://cross-lfs.org/files/packages/svn/shadow-&shadow-version;.tar.bz2">
|
---|
9 | <!ENTITY shadow-download-ftp "ftp://ftp.pld.org.pl/software/shadow/shadow-&shadow-version;.tar.bz2">
|
---|
10 | <!ENTITY shadow-md5sum "e7751d46ecf219c07ae0b028ab3335c6">
|
---|
11 | <!ENTITY shadow-size "1.5 MB">
|
---|
12 | <!ENTITY shadow-buildsize "18 MB">
|
---|
13 | <!ENTITY shadow-time "0.3 SBU">
|
---|
14 | ]>
|
---|
15 |
|
---|
16 | <sect1 id="shadow" xreflabel="Shadow-&shadow-version;">
|
---|
17 | <?dbhtml filename="shadow.html"?>
|
---|
18 |
|
---|
19 | <sect1info>
|
---|
20 | <othername>$LastChangedBy$</othername>
|
---|
21 | <date>$Date$</date>
|
---|
22 | </sect1info>
|
---|
23 |
|
---|
24 | <title>Shadow-&shadow-version;</title>
|
---|
25 |
|
---|
26 | <indexterm zone="shadow">
|
---|
27 | <primary sortas="a-Shadow">Shadow</primary>
|
---|
28 | </indexterm>
|
---|
29 |
|
---|
30 | <sect2 role="package">
|
---|
31 | <title>Introduction to Shadow</title>
|
---|
32 |
|
---|
33 | <para><application>Shadow</application> was indeed installed in LFS and
|
---|
34 | there is no reason to reinstall it unless you installed
|
---|
35 | <application>CrackLib</application> or
|
---|
36 | <application>Linux-PAM</application> after your LFS system was completed.
|
---|
37 | If you have installed <application>CrackLib</application> after LFS, then
|
---|
38 | reinstalling <application>Shadow</application> will enable strong password
|
---|
39 | support. If you have installed <application>Linux-PAM</application>,
|
---|
40 | reinstalling <application>Shadow</application> will allow programs such as
|
---|
41 | <command>login</command> and <command>su</command> to utilize PAM.</para>
|
---|
42 |
|
---|
43 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
44 | <itemizedlist spacing="compact">
|
---|
45 | <listitem>
|
---|
46 | <para>Download (HTTP): <ulink url="&shadow-download-http;"/></para>
|
---|
47 | </listitem>
|
---|
48 | <listitem>
|
---|
49 | <para>Download (FTP): <ulink url="&shadow-download-ftp;"/></para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>Download MD5 sum: &shadow-md5sum;</para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>Download size: &shadow-size;</para>
|
---|
56 | </listitem>
|
---|
57 | <listitem>
|
---|
58 | <para>Estimated disk space required: &shadow-buildsize;</para>
|
---|
59 | </listitem>
|
---|
60 | <listitem>
|
---|
61 | <para>Estimated build time: &shadow-time;</para>
|
---|
62 | </listitem>
|
---|
63 | </itemizedlist>
|
---|
64 |
|
---|
65 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
66 | <itemizedlist spacing='compact'>
|
---|
67 | <listitem>
|
---|
68 | <para>Required patch: <ulink
|
---|
69 | url="&patch-root;/shadow-&shadow-version;-useradd_fix-2.patch"/></para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
73 | <bridgehead renderas="sect3">Shadow Dependencies</bridgehead>
|
---|
74 |
|
---|
75 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
76 | <para role="required"><xref linkend="linux-pam"/> and/or
|
---|
77 | <xref linkend="cracklib"/></para>
|
---|
78 |
|
---|
79 | <para condition="html" role="usernotes">User Notes:
|
---|
80 | <ulink url="&blfs-wiki;/shadow"/></para>
|
---|
81 |
|
---|
82 | </sect2>
|
---|
83 |
|
---|
84 | <sect2 role="installation">
|
---|
85 | <title>Installation of Shadow</title>
|
---|
86 |
|
---|
87 | <important>
|
---|
88 | <para>The installation shown below is for a situation where
|
---|
89 | <application>Linux-PAM</application> has been installed (with or
|
---|
90 | without a <application>CrackLib</application> installation) and
|
---|
91 | <application>Shadow</application> is being reinstalled to support the
|
---|
92 | <application>Linux-PAM</application> installation. If you are
|
---|
93 | reinstalling <application>Shadow</application> to provide strong
|
---|
94 | password support via the <application>CrackLib</application> library
|
---|
95 | and you have not installed <application>Linux-PAM</application>, ensure
|
---|
96 | you add the <parameter>--with-libcrack</parameter> parameter to the
|
---|
97 | <command>configure</command> script below.</para>
|
---|
98 | </important>
|
---|
99 |
|
---|
100 | <para>Reinstall <application>Shadow</application> by running the following
|
---|
101 | commands:</para>
|
---|
102 |
|
---|
103 | <screen><userinput>patch -Np1 -i ../shadow-&shadow-version;-useradd_fix-2.patch &&
|
---|
104 |
|
---|
105 | ./configure --libdir=/lib \
|
---|
106 | --sysconfdir=/etc \
|
---|
107 | --enable-shared \
|
---|
108 | --without-selinux &&
|
---|
109 |
|
---|
110 | sed -i 's/groups$(EXEEXT) //' src/Makefile &&
|
---|
111 | find man -name Makefile -exec sed -i 's/groups\.1 / /' {} \; &&
|
---|
112 | sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile &&
|
---|
113 |
|
---|
114 | for i in de es fi fr id it pt_BR; do
|
---|
115 | convert-mans UTF-8 ISO-8859-1 man/${i}/*.?
|
---|
116 | done &&
|
---|
117 |
|
---|
118 | for i in cs hu pl; do
|
---|
119 | convert-mans UTF-8 ISO-8859-2 man/${i}/*.?
|
---|
120 | done &&
|
---|
121 |
|
---|
122 | convert-mans UTF-8 EUC-JP man/ja/*.? &&
|
---|
123 | convert-mans UTF-8 KOI8-R man/ru/*.? &&
|
---|
124 | convert-mans UTF-8 ISO-8859-9 man/tr/*.? &&
|
---|
125 |
|
---|
126 | make</userinput></screen>
|
---|
127 |
|
---|
128 | <para>This package does not come with a test suite.</para>
|
---|
129 |
|
---|
130 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
131 |
|
---|
132 | <screen role="root"><userinput>make install &&
|
---|
133 | mv -v /usr/bin/passwd /bin &&
|
---|
134 | mv -v /lib/libshadow.*a /usr/lib &&
|
---|
135 | rm -v /lib/libshadow.so &&
|
---|
136 | ln -v -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
|
---|
137 |
|
---|
138 | </sect2>
|
---|
139 |
|
---|
140 | <sect2 role="commands">
|
---|
141 | <title>Command Explanations</title>
|
---|
142 |
|
---|
143 | <!-- Removed the -with-libpam and -without-libcrack options from the
|
---|
144 | default as these are the defaults. Pam will automatically be picked
|
---|
145 | up if it is installed, and CrackLib won't be used unless specifically
|
---|
146 | requested via -with-libcrack
|
---|
147 | <para><parameter>-without-libcrack</parameter>: This switch tells
|
---|
148 | <application>Shadow</application> not to use
|
---|
149 | <filename class='libraryfile'>libcrack</filename>. This is desired as
|
---|
150 | <application>Linux-PAM</application> will provide
|
---|
151 | <filename class='libraryfile'>libcrack</filename> functionality.</para>
|
---|
152 | -->
|
---|
153 |
|
---|
154 | <para><parameter>--without-selinux</parameter>: Support for selinux is
|
---|
155 | enabled by default, but selinux is not built in a base LFS system. The
|
---|
156 | <command>configure</command> script will fail if this option is not
|
---|
157 | used.</para>
|
---|
158 |
|
---|
159 | <para><command>sed -i 's/groups$(EXEEXT) //' src/Makefile</command>: This
|
---|
160 | command is used to suppress the installation of the
|
---|
161 | <command>groups</command> program as the version from the
|
---|
162 | <application>Coreutils</application> package installed during LFS is
|
---|
163 | preferred.</para>
|
---|
164 |
|
---|
165 | <para><command>find man -name Makefile -exec ... {} \;</command>: This
|
---|
166 | command is used to suppress the installation of the
|
---|
167 | <command>groups</command> man pages so the existing ones installed from
|
---|
168 | the <application>Coreutils</application> package are not replaced.</para>
|
---|
169 |
|
---|
170 | <para><command>sed -i -e '...' -e '...' man/Makefile</command>: This
|
---|
171 | command disables the installation of Chinese and Korean manual pages, since
|
---|
172 | <application>Man-DB</application> cannot format them properly.</para>
|
---|
173 |
|
---|
174 | <para><command>convert-mans ...</command>: These commands are used to
|
---|
175 | convert some of the man pages so that <application>Man-DB</application>
|
---|
176 | will display them in the expected encodings.</para>
|
---|
177 |
|
---|
178 | <para><command>mv -v /usr/bin/passwd /bin</command>: The
|
---|
179 | <command>passwd</command> program may be needed during times when the
|
---|
180 | <filename class='directory'>/usr</filename> filesystem is not mounted so
|
---|
181 | it is moved into the root partition.</para>
|
---|
182 |
|
---|
183 | <para><command>mv -v ...; rm -v ...; ln -v ...</command>: These commands
|
---|
184 | are used to move the <filename class='libraryfile'>libshadow</filename>
|
---|
185 | library to the root partition to support the moving of the
|
---|
186 | <command>passwd</command> program earlier.</para>
|
---|
187 |
|
---|
188 | </sect2>
|
---|
189 |
|
---|
190 | <sect2 role="configuration">
|
---|
191 | <title>Configuring Shadow</title>
|
---|
192 |
|
---|
193 | <para><application>Shadow</application>'s stock configuration for the
|
---|
194 | <command>useradd</command> utility is not suitable for LFS systems. Use the
|
---|
195 | following commands as the <systemitem class="username">root</systemitem>
|
---|
196 | user to change the default home directory for new users and prevent the
|
---|
197 | creation of mail spool files:</para>
|
---|
198 |
|
---|
199 | <screen role="root"><userinput>useradd -D -b /home &&
|
---|
200 | sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
|
---|
201 |
|
---|
202 | </sect2>
|
---|
203 |
|
---|
204 | <sect2 role="configuration">
|
---|
205 | <title>Configuring Linux-PAM to Work with Shadow</title>
|
---|
206 |
|
---|
207 | <note>
|
---|
208 | <para>The rest of this page is devoted to configuring
|
---|
209 | <application>Shadow</application> to work properly with
|
---|
210 | <application>Linux-PAM</application>. If you do not have
|
---|
211 | <application>Linux-PAM</application> installed, and you reinstalled
|
---|
212 | <application>Shadow</application> to support strong passwords via
|
---|
213 | the <application>CrackLib</application> library, no further configuration
|
---|
214 | is required.</para>
|
---|
215 | </note>
|
---|
216 |
|
---|
217 | <sect3 id="pam.d">
|
---|
218 | <title>Config Files</title>
|
---|
219 |
|
---|
220 | <para><filename>/etc/pam.d/*</filename> or alternatively
|
---|
221 | <filename>/etc/pam.conf, /etc/login.defs and
|
---|
222 | /etc/security/*</filename></para>
|
---|
223 |
|
---|
224 | <indexterm zone="shadow pam.d">
|
---|
225 | <primary sortas="e-etc-pam.d">/etc/pam.d/*</primary>
|
---|
226 | </indexterm>
|
---|
227 |
|
---|
228 | <indexterm zone="shadow pam.d">
|
---|
229 | <primary sortas="e-etc-pam.conf">/etc/pam.conf</primary>
|
---|
230 | </indexterm>
|
---|
231 |
|
---|
232 | <indexterm zone="shadow pam.d">
|
---|
233 | <primary sortas="e-etc-login.defs">/etc/login.defs</primary>
|
---|
234 | </indexterm>
|
---|
235 |
|
---|
236 | <indexterm zone="shadow pam.d">
|
---|
237 | <primary sortas="e-etc-security">/etc/security/*</primary>
|
---|
238 | </indexterm>
|
---|
239 |
|
---|
240 | </sect3>
|
---|
241 |
|
---|
242 | <sect3>
|
---|
243 | <title>Configuration Information</title>
|
---|
244 |
|
---|
245 | <para>Configuring your system to use <application>Linux-PAM</application>
|
---|
246 | can be a complex task. The information below will provide a basic setup
|
---|
247 | so that <application>Shadow</application>'s login and password
|
---|
248 | functionality will work effectively with
|
---|
249 | <application>Linux-PAM</application>. Review the information and links on
|
---|
250 | the <xref linkend="linux-pam"/> page for further configuration
|
---|
251 | information. For information specific to integrating
|
---|
252 | <application>Shadow</application>, <application>Linux-PAM</application>
|
---|
253 | and <application>CrackLib</application>, you can visit the following
|
---|
254 | links:</para>
|
---|
255 |
|
---|
256 | <itemizedlist spacing="compact">
|
---|
257 | <listitem>
|
---|
258 | <para><ulink
|
---|
259 | url="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam-6.html#ss6.3"/></para>
|
---|
260 | </listitem>
|
---|
261 | <listitem>
|
---|
262 | <para><ulink
|
---|
263 | url="http://www.deer-run.com/~hal/sysadmin/pam_cracklib.html"/></para>
|
---|
264 | </listitem>
|
---|
265 | </itemizedlist>
|
---|
266 |
|
---|
267 | <sect4 id="pam-login-defs">
|
---|
268 | <title>Configuring /etc/login.defs</title>
|
---|
269 |
|
---|
270 | <para>The <command>login</command> program currently performs many
|
---|
271 | functions which <application>Linux-PAM</application> modules should
|
---|
272 | now handle. The following <command>sed</command> command will comment
|
---|
273 | out the appropriate lines in <filename>/etc/login.defs</filename>, and
|
---|
274 | stop <command>login</command> from performing these functions (a backup
|
---|
275 | file named <filename>/etc/login.defs.orig</filename> is also created
|
---|
276 | to preserve the original file's contents). Issue the following commands
|
---|
277 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
278 |
|
---|
279 | <indexterm zone="shadow pam-login-defs">
|
---|
280 | <primary sortas="e-etc-login.defs">/etc/login.defs</primary>
|
---|
281 | </indexterm>
|
---|
282 |
|
---|
283 | <screen role="root"><userinput>install -v -m644 /etc/login.defs /etc/login.defs.orig &&
|
---|
284 | for FUNCTION in LASTLOG_ENAB MAIL_CHECK_ENAB \
|
---|
285 | PORTTIME_CHECKS_ENAB CONSOLE \
|
---|
286 | MOTD_FILE NOLOGINS_FILE PASS_MIN_LEN \
|
---|
287 | SU_WHEEL_ONLY MD5_CRYPT_ENAB \
|
---|
288 | CONSOLE_GROUPS ENVIRON_FILE \
|
---|
289 | ULIMIT ENV_TZ ENV_HZ ENV_SUPATH \
|
---|
290 | ENV_PATH QMAIL_DIR MAIL_DIR MAIL_FILE \
|
---|
291 | CHFN_AUTH FAILLOG_ENAB QUOTAS_ENAB FTMP_FILE \
|
---|
292 | OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
|
---|
293 | PASS_CHANGE_TRIES PASS_ALWAYS_WARN ISSUE_FILE
|
---|
294 | do
|
---|
295 | sed -i "s/^$FUNCTION/# &/" /etc/login.defs
|
---|
296 | done</userinput></screen>
|
---|
297 |
|
---|
298 | <!-- Moved the commenting of these four parameters into the section
|
---|
299 | above. If PAM is installed, it complains if these are not commented
|
---|
300 | regardless if CrackLib is installed.
|
---|
301 |
|
---|
302 | <para>If you have <application>CrackLib</application> installed,
|
---|
303 | also comment out four more lines using the following command as the
|
---|
304 | <systemitem class="username">root</systemitem> user:</para>
|
---|
305 |
|
---|
306 | <screen role="root"><userinput>for FUNCTION in OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
|
---|
307 | PASS_CHANGE_TRIES PASS_ALWAYS_WARN
|
---|
308 | do
|
---|
309 | sed -i "s/^$FUNCTION/# &/" /etc/login.defs
|
---|
310 | done</userinput></screen>
|
---|
311 |
|
---|
312 | -->
|
---|
313 |
|
---|
314 | </sect4>
|
---|
315 |
|
---|
316 | <sect4>
|
---|
317 | <title>Configuring the /etc/pam.d/ Files</title>
|
---|
318 |
|
---|
319 | <para>As mentioned previously in the
|
---|
320 | <application>Linux-PAM</application> instructions,
|
---|
321 | <application>Linux-PAM</application> has two supported methods for
|
---|
322 | configuration. The commands below assume that you've chosen to use
|
---|
323 | a directory based configuration, where each program has its own
|
---|
324 | configuration file. You can optionally use a single
|
---|
325 | <filename>/etc/pam.conf</filename> configuration file by using the
|
---|
326 | text from the files below, and supplying the program name as an
|
---|
327 | additional first field for each line.</para>
|
---|
328 |
|
---|
329 | <para>As the <systemitem class="username">root</systemitem> user,
|
---|
330 | create the <filename class="directory">/etc/pam.d</filename>
|
---|
331 | directory with the following command:</para>
|
---|
332 |
|
---|
333 | <screen role="root"><userinput>install -v -d -m755 /etc/pam.d</userinput></screen>
|
---|
334 |
|
---|
335 | <para>While still the <systemitem class="username">root</systemitem>
|
---|
336 | user, add the following <application>Linux-PAM</application>
|
---|
337 | configuration files to the
|
---|
338 | <filename class="directory">/etc/pam.d/</filename> directory (or
|
---|
339 | add the contents to the <filename>/etc/pam.conf</filename> file) with
|
---|
340 | the following commands:</para>
|
---|
341 |
|
---|
342 | </sect4>
|
---|
343 |
|
---|
344 | <sect4>
|
---|
345 | <title>'login' (with CrackLib)</title>
|
---|
346 |
|
---|
347 | <screen role="root"><userinput>cat > /etc/pam.d/login << "EOF"
|
---|
348 | <literal># Begin /etc/pam.d/login
|
---|
349 |
|
---|
350 | auth requisite pam_nologin.so
|
---|
351 | auth required pam_securetty.so
|
---|
352 | auth required pam_unix.so
|
---|
353 | account required pam_access.so
|
---|
354 | account required pam_unix.so
|
---|
355 | session required pam_env.so
|
---|
356 | session required pam_motd.so
|
---|
357 | session required pam_limits.so
|
---|
358 | session optional pam_mail.so dir=/var/mail standard
|
---|
359 | session optional pam_lastlog.so
|
---|
360 | session required pam_unix.so
|
---|
361 | password required pam_cracklib.so retry=3
|
---|
362 | password required pam_unix.so md5 shadow use_authtok
|
---|
363 |
|
---|
364 | # End /etc/pam.d/login</literal>
|
---|
365 | EOF</userinput></screen>
|
---|
366 |
|
---|
367 | </sect4>
|
---|
368 |
|
---|
369 | <sect4>
|
---|
370 | <title>'login' (without CrackLib)</title>
|
---|
371 |
|
---|
372 | <screen role="root"><userinput>cat > /etc/pam.d/login << "EOF"
|
---|
373 | <literal># Begin /etc/pam.d/login
|
---|
374 |
|
---|
375 | auth requisite pam_nologin.so
|
---|
376 | auth required pam_securetty.so
|
---|
377 | auth required pam_env.so
|
---|
378 | auth required pam_unix.so
|
---|
379 | account required pam_access.so
|
---|
380 | account required pam_unix.so
|
---|
381 | session required pam_motd.so
|
---|
382 | session required pam_limits.so
|
---|
383 | session optional pam_mail.so dir=/var/mail standard
|
---|
384 | session optional pam_lastlog.so
|
---|
385 | session required pam_unix.so
|
---|
386 | password required pam_unix.so md5 shadow
|
---|
387 |
|
---|
388 | # End /etc/pam.d/login</literal>
|
---|
389 | EOF</userinput></screen>
|
---|
390 |
|
---|
391 | </sect4>
|
---|
392 |
|
---|
393 | <sect4>
|
---|
394 | <title>'passwd' (with CrackLib)</title>
|
---|
395 |
|
---|
396 | <screen role="root"><userinput>cat > /etc/pam.d/passwd << "EOF"
|
---|
397 | <literal># Begin /etc/pam.d/passwd
|
---|
398 |
|
---|
399 | password required pam_cracklib.so type=Linux retry=1 \
|
---|
400 | difok=5 diffignore=23 minlen=9 \
|
---|
401 | dcredit=1 ucredit=1 lcredit=1 \
|
---|
402 | ocredit=1 \
|
---|
403 | dictpath=/lib/cracklib/pw_dict
|
---|
404 | password required pam_unix.so md5 shadow use_authtok
|
---|
405 |
|
---|
406 | # End /etc/pam.d/passwd</literal>
|
---|
407 | EOF</userinput></screen>
|
---|
408 |
|
---|
409 | <note><para>In its default configuration, owing to credits,
|
---|
410 | pam_cracklib will allow multiple case passwords as short as 6
|
---|
411 | characters, even with the <parameter>minlen</parameter> value
|
---|
412 | set to 11. You should review the pam_cracklib(8) man page and
|
---|
413 | determine if these default values are acceptable for the security
|
---|
414 | of your system.</para></note>
|
---|
415 |
|
---|
416 | </sect4>
|
---|
417 |
|
---|
418 | <sect4>
|
---|
419 | <title>'passwd' (without CrackLib)</title>
|
---|
420 |
|
---|
421 | <screen role="root"><userinput>cat > /etc/pam.d/passwd << "EOF"
|
---|
422 | <literal># Begin /etc/pam.d/passwd
|
---|
423 |
|
---|
424 | password required pam_unix.so md5 shadow
|
---|
425 |
|
---|
426 | # End /etc/pam.d/passwd</literal>
|
---|
427 | EOF</userinput></screen>
|
---|
428 |
|
---|
429 | </sect4>
|
---|
430 |
|
---|
431 | <sect4>
|
---|
432 | <title>'su'</title>
|
---|
433 |
|
---|
434 | <screen role="root"><userinput>cat > /etc/pam.d/su << "EOF"
|
---|
435 | <literal># Begin /etc/pam.d/su
|
---|
436 |
|
---|
437 | auth sufficient pam_rootok.so
|
---|
438 | auth required pam_unix.so
|
---|
439 | account required pam_unix.so
|
---|
440 | session optional pam_mail.so dir=/var/mail standard
|
---|
441 | session required pam_env.so
|
---|
442 | session required pam_unix.so
|
---|
443 |
|
---|
444 | # End /etc/pam.d/su</literal>
|
---|
445 | EOF</userinput></screen>
|
---|
446 |
|
---|
447 | </sect4>
|
---|
448 |
|
---|
449 | <sect4>
|
---|
450 | <title>'chage'</title>
|
---|
451 |
|
---|
452 | <screen role="root"><userinput>cat > /etc/pam.d/chage << "EOF"
|
---|
453 | <literal># Begin /etc/pam.d/chage
|
---|
454 |
|
---|
455 | auth sufficient pam_rootok.so
|
---|
456 | auth required pam_unix.so
|
---|
457 | account required pam_unix.so
|
---|
458 | session required pam_unix.so
|
---|
459 | password required pam_permit.so
|
---|
460 |
|
---|
461 | # End /etc/pam.d/chage</literal>
|
---|
462 | EOF</userinput></screen>
|
---|
463 |
|
---|
464 | </sect4>
|
---|
465 |
|
---|
466 | <sect4>
|
---|
467 | <title>'chpasswd', 'chgpasswd', 'groupadd', 'groupdel', 'groupmems',
|
---|
468 | 'groupmod', 'newusers', 'useradd', 'userdel', and 'usermod'</title>
|
---|
469 |
|
---|
470 | <screen role="root"><userinput>for PROGRAM in chpasswd chgpasswd groupadd groupdel groupmems \
|
---|
471 | groupmod newusers useradd userdel usermod
|
---|
472 | do
|
---|
473 | install -v -m644 /etc/pam.d/chage /etc/pam.d/$PROGRAM
|
---|
474 | sed -i "s/chage/$PROGRAM/" /etc/pam.d/$PROGRAM
|
---|
475 | done</userinput></screen>
|
---|
476 |
|
---|
477 | <warning>
|
---|
478 | <para>At this point, you should do a simple test to see if
|
---|
479 | <application>Shadow</application> is working as expected. Open
|
---|
480 | another terminal and log in as a user, then <command>su</command> to
|
---|
481 | <systemitem class="username">root</systemitem>. If you do not see any
|
---|
482 | errors, then all is well and you should proceed with the rest of the
|
---|
483 | configuration. If you did receive errors, stop now and double check
|
---|
484 | the above configuration files manually. You can also run the test
|
---|
485 | suite from the <application>Linux-PAM</application> package to assist
|
---|
486 | you in determining the problem. If you cannot find and
|
---|
487 | fix the error, you should recompile <application>Shadow</application>
|
---|
488 | replacing <option>--with-libpam</option> with
|
---|
489 | <option>--without-libpam</option> in the above instructions (also move
|
---|
490 | the <filename>/etc/login.defs.orig</filename> backup file to
|
---|
491 | <filename>/etc/login.defs</filename>). If you
|
---|
492 | fail to do this and the errors remain, you will be unable to log into
|
---|
493 | your system.</para>
|
---|
494 | </warning>
|
---|
495 |
|
---|
496 | </sect4>
|
---|
497 |
|
---|
498 | <sect4>
|
---|
499 | <title>Other</title>
|
---|
500 |
|
---|
501 | <para>Currently, <filename>/etc/pam.d/other</filename> is configured
|
---|
502 | to allow anyone with an account on the machine to use PAM-aware
|
---|
503 | programs without a configuration file for that program. After testing
|
---|
504 | <application>Linux-PAM</application> for proper configuration, install
|
---|
505 | a more restrictive <filename>other</filename> file so that
|
---|
506 | program-specific configuration files are required:</para>
|
---|
507 |
|
---|
508 | <screen role="root"><userinput>cat > /etc/pam.d/other << "EOF"
|
---|
509 | <literal># Begin /etc/pam.d/other
|
---|
510 |
|
---|
511 | auth required pam_deny.so
|
---|
512 | auth required pam_warn.so
|
---|
513 | account required pam_deny.so
|
---|
514 | session required pam_deny.so
|
---|
515 | password required pam_deny.so
|
---|
516 | password required pam_warn.so
|
---|
517 |
|
---|
518 | # End /etc/pam.d/other</literal>
|
---|
519 | EOF</userinput></screen>
|
---|
520 |
|
---|
521 | <para>If you preserved the source tree from the
|
---|
522 | <application>Linux-PAM</application> package (or you feel like unpacking
|
---|
523 | that tarball, then running <command>configure</command> and
|
---|
524 | <command>make</command>), now would be a good time to run the test
|
---|
525 | suite from this package. This test suite will use the configuration you
|
---|
526 | just finished during the tests. All the tests should pass.</para>
|
---|
527 |
|
---|
528 | </sect4>
|
---|
529 |
|
---|
530 | <sect4 id="pam-access">
|
---|
531 | <title>Configuring Login Access</title>
|
---|
532 |
|
---|
533 | <para>Instead of using the <filename>/etc/login.access</filename>
|
---|
534 | file for controlling access to the system,
|
---|
535 | <application>Linux-PAM</application> uses the
|
---|
536 | <filename class='libraryfile'>pam_access.so</filename> module along
|
---|
537 | with the <filename>/etc/security/access.conf</filename> file. Rename
|
---|
538 | the <filename>/etc/login.access</filename> file using the following
|
---|
539 | command:</para>
|
---|
540 |
|
---|
541 | <indexterm zone="shadow pam-access">
|
---|
542 | <primary sortas="e-etc-security-access.conf">/etc/security/access.conf</primary>
|
---|
543 | </indexterm>
|
---|
544 |
|
---|
545 | <screen role="root"><userinput>if [ -f /etc/login.access ]; then
|
---|
546 | mv -v /etc/login.access /etc/login.access.NOUSE
|
---|
547 | fi</userinput></screen>
|
---|
548 |
|
---|
549 | </sect4>
|
---|
550 |
|
---|
551 | <sect4 id="pam-limits">
|
---|
552 | <title>Configuring Resource Limits</title>
|
---|
553 |
|
---|
554 | <para>Instead of using the <filename>/etc/limits</filename> file
|
---|
555 | for limiting usage of system resources,
|
---|
556 | <application>Linux-PAM</application> uses the
|
---|
557 | <filename class='libraryfile'>pam_limits.so</filename> module along
|
---|
558 | with the <filename>/etc/security/limits.conf</filename> file. Rename
|
---|
559 | the <filename>/etc/limits</filename> file using the following
|
---|
560 | command:</para>
|
---|
561 |
|
---|
562 | <indexterm zone="shadow pam-limits">
|
---|
563 | <primary sortas="e-etc-security-limits.conf">/etc/security/limits.conf</primary>
|
---|
564 | </indexterm>
|
---|
565 |
|
---|
566 | <screen role="root"><userinput>if [ -f /etc/limits ]; then
|
---|
567 | mv -v /etc/limits /etc/limits.NOUSE
|
---|
568 | fi</userinput></screen>
|
---|
569 |
|
---|
570 | </sect4>
|
---|
571 |
|
---|
572 | <sect4 id="pam-env">
|
---|
573 | <title>Configuring Default Environment</title>
|
---|
574 |
|
---|
575 | <para>During previous configuration, several items were removed from
|
---|
576 | <filename>/etc/login.defs</filename>. Some of these items are now
|
---|
577 | controlled by the <filename class='libraryfile'>pam_env.so</filename>
|
---|
578 | module and the <filename>/etc/security/pam_env.conf</filename>
|
---|
579 | configuration file. In particular, the default path has been
|
---|
580 | changed. To recover your default path, execute the following
|
---|
581 | commands:</para>
|
---|
582 |
|
---|
583 | <screen role="root"><userinput>ENV_PATH=`grep '^ENV_PATH' /etc/login.defs.orig | \
|
---|
584 | awk '{ print $2 }' | sed 's/PATH=//'` &&
|
---|
585 | echo 'PATH DEFAULT='`echo "${ENV_PATH}"`\
|
---|
586 | ' OVERRIDE=${PATH}' \
|
---|
587 | >> /etc/security/pam_env.conf &&
|
---|
588 | unset ENV_PATH</userinput></screen>
|
---|
589 |
|
---|
590 | <note>
|
---|
591 | <para>ENV_SUPATH is no longer supported. You must create
|
---|
592 | a valid <filename>/root/.bashrc</filename> file to provide a
|
---|
593 | modified path for the super-user.</para>
|
---|
594 | </note>
|
---|
595 |
|
---|
596 | </sect4>
|
---|
597 |
|
---|
598 | </sect3>
|
---|
599 |
|
---|
600 | </sect2>
|
---|
601 |
|
---|
602 | <sect2 role="content">
|
---|
603 | <title>Contents</title>
|
---|
604 |
|
---|
605 | <para>A list of the installed files, along with their short descriptions
|
---|
606 | can be found at
|
---|
607 | <ulink url="&lfs-root;/chapter06/shadow.html#contents-shadow"/>.</para>
|
---|
608 |
|
---|
609 | </sect2>
|
---|
610 |
|
---|
611 | </sect1>
|
---|