source: chapter06/shadow.xml@ 39ec01c

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.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 39ec01c was ed21235, checked in by Matthew Burgess <matthew@…>, 12 years ago

Upgrade to Shadow-4.1.5. Fixes #3019.

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

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