source: chapter06/shadow.xml@ aca25d4

7.5-systemd 7.6-systemd 7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since aca25d4 was cb02946, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Lots of spelling fixes.
Delete the no longer used lsb-bootscripts directory

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

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