source: chapter08/shadow.xml@ ff96923

11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 arm ml-11.0 multilib trunk xry111/clfs-ng xry111/glibc-2.34 xry111/lfs-next
Last change on this file since ff96923 was ff96923, checked in by Bruce Dubbs <bdubbs@…>, 11 months ago

Package updates and stripping fixes
Add workaround to strip libraries correctly.
Update to shadow-4.9.
Update to util-linux 2.37.1.

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