source: chapter06/shadow.xml@ d35b7f3

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 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/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since d35b7f3 was 3fe83ff2, checked in by Matthew Burgess <matthew@…>, 15 years ago

Upgrade to Shadow-4.1.4. Fixes #2394.

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

  • Property mode set to 100644
File size: 20.5 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</userinput></screen>
96
97 <para>Compile the package:</para>
98
99<screen><userinput remap="make">make</userinput></screen>
100
101 <para>This package does not come with a test suite.</para>
102
103 <para>Install the package:</para>
104
105<screen><userinput remap="install">make install</userinput></screen>
106
107 <para>Move a misplaced program to its proper location:</para>
108
109<screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
110
111 <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
112
113<screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
114rm -v /lib/libshadow.so
115ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
116
117 </sect2>
118
119 <sect2 id="conf-shadow" role="configuration">
120 <title>Configuring Shadow</title>
121
122 <indexterm zone="conf-shadow">
123 <primary sortas="a-Shadow">Shadow</primary>
124 <secondary>configuring</secondary>
125 </indexterm>
126
127 <para>This package contains utilities to add, modify, and delete users and
128 groups; set and change their passwords; and perform other administrative
129 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
130 means, see the <filename>doc/HOWTO</filename> file within the unpacked
131 source tree. If using Shadow support, keep in mind that programs which need
132 to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
133 must be Shadow-compliant. That is, they need to be able to work with
134 shadowed passwords.</para>
135
136 <para>To enable shadowed passwords, run the following command:</para>
137
138<screen><userinput>pwconv</userinput></screen>
139
140 <para>To enable shadowed group passwords, run:</para>
141
142<screen><userinput>grpconv</userinput></screen>
143
144 <para>Shadow's stock configuration for the <command>useradd</command>
145 utility has a few caveats that need some explanation. First, the default
146 action for the <command>useradd</command> utility is to create the user and
147 a group of the same name as the user. By default the user ID (UID) and
148 group ID (GID) numbers will begin with 1000. This means if you don't pass
149 parameters to <command>useradd</command>, each user will be a member of a
150 unique group on the system. If this behaviour is undesireable, you'll need
151 to pass the <parameter>-g</parameter> parameter to
152 <command>useradd</command>. The default parameters are stored in the
153 <filename>/etc/default/useradd</filename> file. You may need to modify two
154 parameters in this file to suit your particular needs.</para>
155
156 <variablelist>
157 <title><filename>/etc/default/useradd</filename> Parameter Explanations</title>
158
159 <varlistentry>
160 <term><parameter>GROUP=1000</parameter></term>
161 <listitem>
162 <para>This parameter sets the beginning of the group numbers used in
163 the /etc/group file. You can modify it to anything you desire. Note
164 that <command>useradd</command> will never reuse a UID or GID. If the
165 number identified in this parameter is used, it will use the next
166 available number after this. Note also that if you don't have a group
167 1000 on your system the first time you use <command>useradd</command>
168 without the <parameter>-g</parameter> parameter, you'll get a message
169 displayed on the terminal that says:
170 <computeroutput>useradd: unknown GID 1000</computeroutput>. You may
171 disregard this message and group number 1000 will be used.</para>
172 </listitem>
173 </varlistentry>
174 <varlistentry>
175 <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
176 <listitem>
177 <para>This parameter causes <command>useradd</command> to create a
178 mailbox file for the newly created user. <command>useradd</command>
179 will make the group ownership of this file to the
180 <systemitem class="groupname">mail</systemitem> group with 0660
181 permissions. If you would prefer that these mailbox files are not
182 created by <command>useradd</command>, issue the following
183 command:</para>
184
185<screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
186 </listitem>
187 </varlistentry>
188
189 </variablelist>
190
191
192 </sect2>
193
194 <sect2 role="configuration">
195 <title>Setting the root password</title>
196
197 <para>Choose a password for user <emphasis>root</emphasis> and set it
198 by running:</para>
199
200<screen role="nodump"><userinput>passwd root</userinput></screen>
201
202 </sect2>
203
204 <sect2 id="contents-shadow" role="content">
205 <title>Contents of Shadow</title>
206
207 <segmentedlist>
208 <segtitle>Installed programs</segtitle>
209
210 <seglistitem>
211 <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
212 groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
213 lastlog, login, logoutd, newgrp, newusers, nologin, passwd, pwck,
214 pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod,
215 vigr (link to vipw), and vipw</seg>
216 </seglistitem>
217 </segmentedlist>
218
219 <variablelist>
220 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
221 <?dbfo list-presentation="list"?>
222 <?dbhtml list-presentation="table"?>
223
224 <varlistentry id="chage">
225 <term><command>chage</command></term>
226 <listitem>
227 <para>Used to change the maximum number of days between obligatory
228 password changes</para>
229 <indexterm zone="ch-system-shadow chage">
230 <primary sortas="b-chage">chage</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="chfn">
236 <term><command>chfn</command></term>
237 <listitem>
238 <para>Used to change a user's full name and other information</para>
239 <indexterm zone="ch-system-shadow chfn">
240 <primary sortas="b-chfn">chfn</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="chgpasswd">
246 <term><command>chgpasswd</command></term>
247 <listitem>
248 <para>Used to update group passwords in batch mode</para>
249 <indexterm zone="ch-system-shadow chgpasswd">
250 <primary sortas="b-chgpasswd">chgpasswd</primary>
251 </indexterm>
252 </listitem>
253 </varlistentry>
254
255 <varlistentry id="chpasswd">
256 <term><command>chpasswd</command></term>
257 <listitem>
258 <para>Used to update user passwords in batch mode</para>
259 <indexterm zone="ch-system-shadow chpasswd">
260 <primary sortas="b-chpasswd">chpasswd</primary>
261 </indexterm>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry id="chsh">
266 <term><command>chsh</command></term>
267 <listitem>
268 <para>Used to change a user's default login shell</para>
269 <indexterm zone="ch-system-shadow chsh">
270 <primary sortas="b-chsh">chsh</primary>
271 </indexterm>
272 </listitem>
273 </varlistentry>
274
275 <varlistentry id="expiry">
276 <term><command>expiry</command></term>
277 <listitem>
278 <para>Checks and enforces the current password expiration policy</para>
279 <indexterm zone="ch-system-shadow expiry">
280 <primary sortas="b-expiry">expiry</primary>
281 </indexterm>
282 </listitem>
283 </varlistentry>
284
285 <varlistentry id="faillog">
286 <term><command>faillog</command></term>
287 <listitem>
288 <para>Is used to examine the log of login failures, to set a maximum
289 number of failures before an account is blocked, or to reset the
290 failure count</para>
291 <indexterm zone="ch-system-shadow faillog">
292 <primary sortas="b-faillog">faillog</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="gpasswd">
298 <term><command>gpasswd</command></term>
299 <listitem>
300 <para>Is used to add and delete members and administrators to
301 groups</para>
302 <indexterm zone="ch-system-shadow gpasswd">
303 <primary sortas="b-gpasswd">gpasswd</primary>
304 </indexterm>
305 </listitem>
306 </varlistentry>
307
308 <varlistentry id="groupadd">
309 <term><command>groupadd</command></term>
310 <listitem>
311 <para>Creates a group with the given name</para>
312 <indexterm zone="ch-system-shadow groupadd">
313 <primary sortas="b-groupadd">groupadd</primary>
314 </indexterm>
315 </listitem>
316 </varlistentry>
317
318 <varlistentry id="groupdel">
319 <term><command>groupdel</command></term>
320 <listitem>
321 <para>Deletes the group with the given name</para>
322 <indexterm zone="ch-system-shadow groupdel">
323 <primary sortas="b-groupdel">groupdel</primary>
324 </indexterm>
325 </listitem>
326 </varlistentry>
327
328 <varlistentry id="groupmems">
329 <term><command>groupmems</command></term>
330 <listitem>
331 <para>Allows a user to administer his/her own group membership list
332 without the requirement of super user privileges.</para>
333 <indexterm zone="ch-system-shadow groupmems">
334 <primary sortas="b-groupmems">groupmems</primary>
335 </indexterm>
336 </listitem>
337 </varlistentry>
338
339 <varlistentry id="groupmod">
340 <term><command>groupmod</command></term>
341 <listitem>
342 <para>Is used to modify the given group's name or GID</para>
343 <indexterm zone="ch-system-shadow groupmod">
344 <primary sortas="b-groupmod">groupmod</primary>
345 </indexterm>
346 </listitem>
347 </varlistentry>
348
349 <varlistentry id="grpck">
350 <term><command>grpck</command></term>
351 <listitem>
352 <para>Verifies the integrity of the group files
353 <filename>/etc/group</filename> and
354 <filename>/etc/gshadow</filename></para>
355 <indexterm zone="ch-system-shadow grpck">
356 <primary sortas="b-grpck">grpck</primary>
357 </indexterm>
358 </listitem>
359 </varlistentry>
360
361 <varlistentry id="grpconv">
362 <term><command>grpconv</command></term>
363 <listitem>
364 <para>Creates or updates the shadow group file from the normal
365 group file</para>
366 <indexterm zone="ch-system-shadow grpconv">
367 <primary sortas="b-grpconv">grpconv</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="grpunconv">
373 <term><command>grpunconv</command></term>
374 <listitem>
375 <para>Updates <filename>/etc/group</filename> from
376 <filename>/etc/gshadow</filename> and then deletes the latter</para>
377 <indexterm zone="ch-system-shadow grpunconv">
378 <primary sortas="b-grpunconv">grpunconv</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
383 <varlistentry id="lastlog">
384 <term><command>lastlog</command></term>
385 <listitem>
386 <para>Reports the most recent login of all users or of a
387 given user</para>
388 <indexterm zone="ch-system-shadow lastlog">
389 <primary sortas="b-lastlog">lastlog</primary>
390 </indexterm>
391 </listitem>
392 </varlistentry>
393
394 <varlistentry id="login">
395 <term><command>login</command></term>
396 <listitem>
397 <para>Is used by the system to let users sign on</para>
398 <indexterm zone="ch-system-shadow login">
399 <primary sortas="b-login">login</primary>
400 </indexterm>
401 </listitem>
402 </varlistentry>
403
404 <varlistentry id="logoutd">
405 <term><command>logoutd</command></term>
406 <listitem>
407 <para>Is a daemon used to enforce restrictions on log-on time
408 and ports</para>
409 <indexterm zone="ch-system-shadow logoutd">
410 <primary sortas="b-logoutd">logoutd</primary>
411 </indexterm>
412 </listitem>
413 </varlistentry>
414
415 <varlistentry id="newgrp">
416 <term><command>newgrp</command></term>
417 <listitem>
418 <para>Is used to change the current GID during a login session</para>
419 <indexterm zone="ch-system-shadow newgrp">
420 <primary sortas="b-newgrp">newgrp</primary>
421 </indexterm>
422 </listitem>
423 </varlistentry>
424
425 <varlistentry id="newusers">
426 <term><command>newusers</command></term>
427 <listitem>
428 <para>Is used to create or update an entire series of user
429 accounts</para>
430 <indexterm zone="ch-system-shadow newusers">
431 <primary sortas="b-newusers">newusers</primary>
432 </indexterm>
433 </listitem>
434 </varlistentry>
435
436 <varlistentry id="nologin">
437 <term><command>nologin</command></term>
438 <listitem>
439 <para>Displays a message that an account is not available. Designed
440 to be used as the default shell for accounts that have been
441 disabled</para>
442 <indexterm zone="ch-system-shadow nologin">
443 <primary sortas="b-nologin">nologin</primary>
444 </indexterm>
445 </listitem>
446 </varlistentry>
447
448 <varlistentry id="passwd">
449 <term><command>passwd</command></term>
450 <listitem>
451 <para>Is used to change the password for a user or group account</para>
452 <indexterm zone="ch-system-shadow passwd">
453 <primary sortas="b-passwd">passwd</primary>
454 </indexterm>
455 </listitem>
456 </varlistentry>
457
458 <varlistentry id="pwck">
459 <term><command>pwck</command></term>
460 <listitem>
461 <para>Verifies the integrity of the password files
462 <filename>/etc/passwd</filename> and
463 <filename>/etc/shadow</filename></para>
464 <indexterm zone="ch-system-shadow pwck">
465 <primary sortas="b-pwck">pwck</primary>
466 </indexterm>
467 </listitem>
468 </varlistentry>
469
470 <varlistentry id="pwconv">
471 <term><command>pwconv</command></term>
472 <listitem>
473 <para>Creates or updates the shadow password file from the normal
474 password file</para>
475 <indexterm zone="ch-system-shadow pwconv">
476 <primary sortas="b-pwconv">pwconv</primary>
477 </indexterm>
478 </listitem>
479 </varlistentry>
480
481 <varlistentry id="pwunconv">
482 <term><command>pwunconv</command></term>
483 <listitem>
484 <para>Updates <filename>/etc/passwd</filename> from
485 <filename>/etc/shadow</filename> and then deletes the latter</para>
486 <indexterm zone="ch-system-shadow pwunconv">
487 <primary sortas="b-pwunconv">pwunconv</primary>
488 </indexterm>
489 </listitem>
490 </varlistentry>
491
492 <varlistentry id="sg">
493 <term><command>sg</command></term>
494 <listitem>
495 <para>Executes a given command while the user's GID
496 is set to that of the given group</para>
497 <indexterm zone="ch-system-shadow sg">
498 <primary sortas="b-sg">sg</primary>
499 </indexterm>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry id="su">
504 <term><command>su</command></term>
505 <listitem>
506 <para>Runs a shell with substitute user and group IDs</para>
507 <indexterm zone="ch-system-shadow su">
508 <primary sortas="b-su">su</primary>
509 </indexterm>
510 </listitem>
511 </varlistentry>
512
513 <varlistentry id="useradd">
514 <term><command>useradd</command></term>
515 <listitem>
516 <para>Creates a new user with the given name, or updates the default
517 new-user information</para>
518 <indexterm zone="ch-system-shadow useradd">
519 <primary sortas="b-useradd">useradd</primary>
520 </indexterm>
521 </listitem>
522 </varlistentry>
523
524 <varlistentry id="userdel">
525 <term><command>userdel</command></term>
526 <listitem>
527 <para>Deletes the given user account</para>
528 <indexterm zone="ch-system-shadow userdel">
529 <primary sortas="b-userdel">userdel</primary>
530 </indexterm>
531 </listitem>
532 </varlistentry>
533
534 <varlistentry id="usermod">
535 <term><command>usermod</command></term>
536 <listitem>
537 <para>Is used to modify the given user's login name, User
538 Identification (UID), shell, initial group, home directory, etc.</para>
539 <indexterm zone="ch-system-shadow usermod">
540 <primary sortas="b-usermod">usermod</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="vigr">
546 <term><command>vigr</command></term>
547 <listitem>
548 <para>Edits the <filename>/etc/group</filename> or
549 <filename>/etc/gshadow</filename> files</para>
550 <indexterm zone="ch-system-shadow vigr">
551 <primary sortas="b-vigr">vigr</primary>
552 </indexterm>
553 </listitem>
554 </varlistentry>
555
556 <varlistentry id="vipw">
557 <term><command>vipw</command></term>
558 <listitem>
559 <para>Edits the <filename>/etc/passwd</filename> or
560 <filename>/etc/shadow</filename> files</para>
561 <indexterm zone="ch-system-shadow vipw">
562 <primary sortas="b-vipw">vipw</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 </variablelist>
568
569 </sect2>
570
571</sect1>
Note: See TracBrowser for help on using the repository browser.