source: chapter08/shadow.xml@ fcc02767

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 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 fcc02767 was fcc02767, checked in by Bruce Dubbs <bdubbs@…>, 4 years ago

Initial commit of alternative cross LFS

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

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