source: chapter06/shadow.xml@ 030875a8

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 7.6 7.7 7.8 7.9 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 030875a8 was 030875a8, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Update users so all acl tests pass

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

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