source: chapter06/shadow.xml@ e211b0d

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since e211b0d was 9f405998, checked in by Matthew Burgess <matthew@…>, 15 years ago

Resolve several man-db encodoing configuration issues. Fixes #2298.

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

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