source: chapter06/shadow.xml@ 61fa521

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 12.2 12.2-rc1 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/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 61fa521 was e836f78, checked in by Matthew Burgess <matthew@…>, 14 years ago

Update description of password encryption sed, following r9447.

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

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