source: chapter06/shadow.xml@ 709d338

Last change on this file since 709d338 was 76f695d, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Splitted some commands to fit into PDF page size.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.2/BOOK@7716 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 19.3 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
8<sect1 id="ch-system-shadow" role="wrap">
9 <?dbhtml filename="shadow.html"?>
10
11 <title>Shadow-&shadow-version;</title>
12
13 <indexterm zone="ch-system-shadow">
14 <primary sortas="a-Shadow">Shadow</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Shadow package contains programs for handling passwords in a secure
21 way.</para>
22
23 <segmentedlist>
24 <segtitle>&buildtime;</segtitle>
25 <segtitle>&diskspace;</segtitle>
26
27 <seglistitem>
28 <seg>&shadow-ch6-sbu;</seg>
29 <seg>&shadow-ch6-du;</seg>
30 </seglistitem>
31 </segmentedlist>
32
33 </sect2>
34
35 <sect2 role="installation">
36 <title>Installation of Shadow</title>
37
38 <note>
39 <para>If you would like to enforce the use of strong passwords, refer to
40 <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing
41 Cracklib prior to building Shadow. Then add
42 <parameter>--with-libcrack</parameter> to the <command>configure</command>
43 command below.</para>
44 </note>
45
46 <para>Prepare Shadow for compilation:</para>
47
48<screen><userinput>./configure --libdir=/lib --enable-shared --without-selinux</userinput></screen>
49
50 <variablelist>
51 <title>The meaning of the configure options:</title>
52
53 <varlistentry>
54 <term><parameter>--without-selinux</parameter></term>
55 <listitem>
56 <para>Support for selinux is enabled by default, but selinux is not
57 built in a base LFS system. The <command>configure</command> script
58 will fail if this option is not used.</para>
59 </listitem>
60 </varlistentry>
61
62 </variablelist>
63
64 <para>Disable the installation of the <command>groups</command> program
65 and its man pages, as Coreutils provides a better version:</para>
66
67<screen><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile
68find man -name Makefile -exec sed -i '/groups/d' {} \;</userinput></screen>
69
70 <para>Disable the installation of Chinese and Korean manual pages, since
71 Man-DB cannot format them properly:</para>
72
73<screen><userinput>sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile</userinput></screen>
74
75 <para>Shadow supplies other manual pages in a UTF-8 encoding. Man-DB
76 can display these in the recommended encodings by using the
77 <command>convert-mans</command> script which we installed.</para>
78
79<screen><userinput> for i in de es fi fr id it pt_BR; do
80 convert-mans UTF-8 ISO-8859-1 man/${i}/*.?
81done
82
83for i in cs hu pl; do
84 convert-mans UTF-8 ISO-8859-2 man/${i}/*.?
85done
86
87convert-mans UTF-8 EUC-JP man/ja/*.?
88convert-mans UTF-8 KOI8-R man/ru/*.?
89convert-mans UTF-8 ISO-8859-9 man/tr/*.?</userinput></screen>
90
91 <para>Compile the package:</para>
92
93<screen><userinput>make</userinput></screen>
94
95 <para>This package does not come with a test suite.</para>
96
97 <para>Install the package:</para>
98
99<screen><userinput>make install</userinput></screen>
100
101 <para id="shadow-limits-login_access">Shadow uses two files to configure
102 authentication settings for the system. Install these two configuration
103 files:</para>
104
105 <indexterm zone="shadow-limits-login_access">
106 <primary sortas="e-/etc/limits">/etc/limits</primary>
107 </indexterm>
108
109 <indexterm zone="shadow-limits-login_access">
110 <primary sortas="e-/etc/login.access">/etc/login.access</primary>
111 </indexterm>
112
113<screen><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen>
114
115 <para id="shadow-login_defs">Instead of using the default
116 <emphasis>crypt</emphasis> method, use the more secure
117 <emphasis>MD5</emphasis> method of password encryption, which also allows
118 passwords longer than 8 characters. It is also necessary to change the
119 obsolete <filename class="directory">/var/spool/mail</filename> location
120 for user mailboxes that Shadow uses by default to the <filename
121 class="directory">/var/mail</filename> location used currently. Both of
122 these can be accomplished by changing the relevant configuration file
123 while copying it to its destination:</para>
124
125 <indexterm zone="shadow-login_defs">
126 <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
127 </indexterm>
128
129<screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
130 -e 's@/var/spool/mail@/var/mail@' \
131 etc/login.defs &gt; /etc/login.defs</userinput></screen>
132
133 <note>
134 <para>If you built Shadow with Cracklib support, run the following:</para>
135
136<screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
137 /etc/login.defs</userinput></screen>
138 </note>
139
140 <para>Move a misplaced program to its proper location:</para>
141
142<screen><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
143
144 <para>Move Shadow's libraries to more appropriate locations:</para>
145
146<screen><userinput>mv -v /lib/libshadow.*a /usr/lib
147rm -v /lib/libshadow.so
148ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
149
150 <para>The <parameter>-D</parameter> option of the
151 <command>useradd</command> program requires the <filename
152 class="directory">/etc/default</filename> directory for it to work
153 properly:</para>
154
155<screen><userinput>mkdir -v /etc/default</userinput></screen>
156
157 </sect2>
158
159 <sect2 id="conf-shadow" role="configuration">
160 <title>Configuring Shadow</title>
161
162 <indexterm zone="conf-shadow">
163 <primary sortas="a-Shadow">Shadow</primary>
164 <secondary>configuring</secondary>
165 </indexterm>
166
167 <para>This package contains utilities to add, modify, and delete users and
168 groups; set and change their passwords; and perform other administrative
169 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
170 means, see the <filename>doc/HOWTO</filename> file within the unpacked
171 source tree. If using Shadow support, keep in mind that programs which need
172 to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
173 must be Shadow-compliant. That is, they need to be able to work with
174 shadowed passwords.</para>
175
176 <para>To enable shadowed passwords, run the following command:</para>
177
178<screen><userinput>pwconv</userinput></screen>
179
180 <para>To enable shadowed group passwords, run:</para>
181
182<screen><userinput>grpconv</userinput></screen>
183
184 </sect2>
185
186 <sect2 role="configuration">
187 <title>Setting the root password</title>
188
189 <para>Choose a password for user <emphasis>root</emphasis> and set it
190 by running:</para>
191
192<screen role="nodump"><userinput>passwd root</userinput></screen>
193
194 </sect2>
195
196 <sect2 id="contents-shadow" role="content">
197 <title>Contents of Shadow</title>
198
199 <segmentedlist>
200 <segtitle>Installed programs</segtitle>
201 <segtitle>Installed libraries</segtitle>
202
203 <seglistitem>
204 <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
205 groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login,
206 logoutd, newgrp, newusers, nologin, passwd, pwck, pwconv, pwunconv, sg (link to
207 newgrp), su, useradd, userdel, usermod, vigr (link to vipw), and
208 vipw</seg>
209 <seg>libshadow.{a,so}</seg>
210 </seglistitem>
211 </segmentedlist>
212
213 <variablelist>
214 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
215 <?dbfo list-presentation="list"?>
216 <?dbhtml list-presentation="table"?>
217
218 <varlistentry id="chage">
219 <term><command>chage</command></term>
220 <listitem>
221 <para>Used to change the maximum number of days between obligatory
222 password changes</para>
223 <indexterm zone="ch-system-shadow chage">
224 <primary sortas="b-chage">chage</primary>
225 </indexterm>
226 </listitem>
227 </varlistentry>
228
229 <varlistentry id="chfn">
230 <term><command>chfn</command></term>
231 <listitem>
232 <para>Used to change a user's full name and other information</para>
233 <indexterm zone="ch-system-shadow chfn">
234 <primary sortas="b-chfn">chfn</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry id="chgpasswd">
240 <term><command>chgpasswd</command></term>
241 <listitem>
242 <para>Used to update group passwords in batch mode</para>
243 <indexterm zone="ch-system-shadow chgpasswd">
244 <primary sortas="b-chgpasswd">chgpasswd</primary>
245 </indexterm>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry id="chpasswd">
250 <term><command>chpasswd</command></term>
251 <listitem>
252 <para>Used to update user passwords in batch mode</para>
253 <indexterm zone="ch-system-shadow chpasswd">
254 <primary sortas="b-chpasswd">chpasswd</primary>
255 </indexterm>
256 </listitem>
257 </varlistentry>
258
259 <varlistentry id="chsh">
260 <term><command>chsh</command></term>
261 <listitem>
262 <para>Used to change a user's default login shell</para>
263 <indexterm zone="ch-system-shadow chsh">
264 <primary sortas="b-chsh">chsh</primary>
265 </indexterm>
266 </listitem>
267 </varlistentry>
268
269 <varlistentry id="expiry">
270 <term><command>expiry</command></term>
271 <listitem>
272 <para>Checks and enforces the current password expiration policy</para>
273 <indexterm zone="ch-system-shadow expiry">
274 <primary sortas="b-expiry">expiry</primary>
275 </indexterm>
276 </listitem>
277 </varlistentry>
278
279 <varlistentry id="faillog">
280 <term><command>faillog</command></term>
281 <listitem>
282 <para>Is used to examine the log of login failures, to set a maximum
283 number of failures before an account is blocked, or to reset the
284 failure count</para>
285 <indexterm zone="ch-system-shadow faillog">
286 <primary sortas="b-faillog">faillog</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="gpasswd">
292 <term><command>gpasswd</command></term>
293 <listitem>
294 <para>Is used to add and delete members and administrators to
295 groups</para>
296 <indexterm zone="ch-system-shadow gpasswd">
297 <primary sortas="b-gpasswd">gpasswd</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry id="groupadd">
303 <term><command>groupadd</command></term>
304 <listitem>
305 <para>Creates a group with the given name</para>
306 <indexterm zone="ch-system-shadow groupadd">
307 <primary sortas="b-groupadd">groupadd</primary>
308 </indexterm>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry id="groupdel">
313 <term><command>groupdel</command></term>
314 <listitem>
315 <para>Deletes the group with the given name</para>
316 <indexterm zone="ch-system-shadow groupdel">
317 <primary sortas="b-groupdel">groupdel</primary>
318 </indexterm>
319 </listitem>
320 </varlistentry>
321
322 <varlistentry id="groupmod">
323 <term><command>groupmod</command></term>
324 <listitem>
325 <para>Is used to modify the given group's name or GID</para>
326 <indexterm zone="ch-system-shadow groupmod">
327 <primary sortas="b-groupmod">groupmod</primary>
328 </indexterm>
329 </listitem>
330 </varlistentry>
331
332 <varlistentry id="grpck">
333 <term><command>grpck</command></term>
334 <listitem>
335 <para>Verifies the integrity of the group files
336 <filename>/etc/group</filename> and
337 <filename>/etc/gshadow</filename></para>
338 <indexterm zone="ch-system-shadow grpck">
339 <primary sortas="b-grpck">grpck</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
343
344 <varlistentry id="grpconv">
345 <term><command>grpconv</command></term>
346 <listitem>
347 <para>Creates or updates the shadow group file from the normal
348 group file</para>
349 <indexterm zone="ch-system-shadow grpconv">
350 <primary sortas="b-grpconv">grpconv</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry id="grpunconv">
356 <term><command>grpunconv</command></term>
357 <listitem>
358 <para>Updates <filename>/etc/group</filename> from
359 <filename>/etc/gshadow</filename> and then deletes the latter</para>
360 <indexterm zone="ch-system-shadow grpunconv">
361 <primary sortas="b-grpunconv">grpunconv</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="lastlog">
367 <term><command>lastlog</command></term>
368 <listitem>
369 <para>Reports the most recent login of all users or of a
370 given user</para>
371 <indexterm zone="ch-system-shadow lastlog">
372 <primary sortas="b-lastlog">lastlog</primary>
373 </indexterm>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry id="login">
378 <term><command>login</command></term>
379 <listitem>
380 <para>Is used by the system to let users sign on</para>
381 <indexterm zone="ch-system-shadow login">
382 <primary sortas="b-login">login</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="logoutd">
388 <term><command>logoutd</command></term>
389 <listitem>
390 <para>Is a daemon used to enforce restrictions on log-on time
391 and ports</para>
392 <indexterm zone="ch-system-shadow logoutd">
393 <primary sortas="b-logoutd">logoutd</primary>
394 </indexterm>
395 </listitem>
396 </varlistentry>
397
398 <varlistentry id="newgrp">
399 <term><command>newgrp</command></term>
400 <listitem>
401 <para>Is used to change the current GID during a login session</para>
402 <indexterm zone="ch-system-shadow newgrp">
403 <primary sortas="b-newgrp">newgrp</primary>
404 </indexterm>
405 </listitem>
406 </varlistentry>
407
408 <varlistentry id="newusers">
409 <term><command>newusers</command></term>
410 <listitem>
411 <para>Is used to create or update an entire series of user
412 accounts</para>
413 <indexterm zone="ch-system-shadow newusers">
414 <primary sortas="b-newusers">newusers</primary>
415 </indexterm>
416 </listitem>
417 </varlistentry>
418
419 <varlistentry id="nologin">
420 <term><command>nologin</command></term>
421 <listitem>
422 <para>Displays a message that an account is not available. Designed
423 to be used as the default shell for accounts that have been
424 disabled</para>
425 <indexterm zone="ch-system-shadow nologin">
426 <primary sortas="b-nologin">nologin</primary>
427 </indexterm>
428 </listitem>
429 </varlistentry>
430
431 <varlistentry id="passwd">
432 <term><command>passwd</command></term>
433 <listitem>
434 <para>Is used to change the password for a user or group account</para>
435 <indexterm zone="ch-system-shadow passwd">
436 <primary sortas="b-passwd">passwd</primary>
437 </indexterm>
438 </listitem>
439 </varlistentry>
440
441 <varlistentry id="pwck">
442 <term><command>pwck</command></term>
443 <listitem>
444 <para>Verifies the integrity of the password files
445 <filename>/etc/passwd</filename> and
446 <filename>/etc/shadow</filename></para>
447 <indexterm zone="ch-system-shadow pwck">
448 <primary sortas="b-pwck">pwck</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="pwconv">
454 <term><command>pwconv</command></term>
455 <listitem>
456 <para>Creates or updates the shadow password file from the normal
457 password file</para>
458 <indexterm zone="ch-system-shadow pwconv">
459 <primary sortas="b-pwconv">pwconv</primary>
460 </indexterm>
461 </listitem>
462 </varlistentry>
463
464 <varlistentry id="pwunconv">
465 <term><command>pwunconv</command></term>
466 <listitem>
467 <para>Updates <filename>/etc/passwd</filename> from
468 <filename>/etc/shadow</filename> and then deletes the latter</para>
469 <indexterm zone="ch-system-shadow pwunconv">
470 <primary sortas="b-pwunconv">pwunconv</primary>
471 </indexterm>
472 </listitem>
473 </varlistentry>
474
475 <varlistentry id="sg">
476 <term><command>sg</command></term>
477 <listitem>
478 <para>Executes a given command while the user's GID
479 is set to that of the given group</para>
480 <indexterm zone="ch-system-shadow sg">
481 <primary sortas="b-sg">sg</primary>
482 </indexterm>
483 </listitem>
484 </varlistentry>
485
486 <varlistentry id="su">
487 <term><command>su</command></term>
488 <listitem>
489 <para>Runs a shell with substitute user and group IDs</para>
490 <indexterm zone="ch-system-shadow su">
491 <primary sortas="b-su">su</primary>
492 </indexterm>
493 </listitem>
494 </varlistentry>
495
496 <varlistentry id="useradd">
497 <term><command>useradd</command></term>
498 <listitem>
499 <para>Creates a new user with the given name, or updates the default
500 new-user information</para>
501 <indexterm zone="ch-system-shadow useradd">
502 <primary sortas="b-useradd">useradd</primary>
503 </indexterm>
504 </listitem>
505 </varlistentry>
506
507 <varlistentry id="userdel">
508 <term><command>userdel</command></term>
509 <listitem>
510 <para>Deletes the given user account</para>
511 <indexterm zone="ch-system-shadow userdel">
512 <primary sortas="b-userdel">userdel</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="usermod">
518 <term><command>usermod</command></term>
519 <listitem>
520 <para>Is used to modify the given user's login name, User
521 Identification (UID), shell, initial group, home directory, etc.</para>
522 <indexterm zone="ch-system-shadow usermod">
523 <primary sortas="b-usermod">usermod</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="vigr">
529 <term><command>vigr</command></term>
530 <listitem>
531 <para>Edits the <filename>/etc/group</filename> or
532 <filename>/etc/gshadow</filename> files</para>
533 <indexterm zone="ch-system-shadow vigr">
534 <primary sortas="b-vigr">vigr</primary>
535 </indexterm>
536 </listitem>
537 </varlistentry>
538
539 <varlistentry id="vipw">
540 <term><command>vipw</command></term>
541 <listitem>
542 <para>Edits the <filename>/etc/passwd</filename> or
543 <filename>/etc/shadow</filename> files</para>
544 <indexterm zone="ch-system-shadow vipw">
545 <primary sortas="b-vipw">vipw</primary>
546 </indexterm>
547 </listitem>
548 </varlistentry>
549
550 <varlistentry id="libshadow">
551 <term><filename class="libraryfile">libshadow</filename></term>
552 <listitem>
553 <para>Contains functions used by most programs in this package</para>
554 <indexterm zone="ch-system-shadow libshadow">
555 <primary sortas="c-libshadow">libshadow</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559
560 </variablelist>
561
562 </sect2>
563
564</sect1>
Note: See TracBrowser for help on using the repository browser.