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