source: chapter06/shadow.xml@ a07a34d

multilib-10.1
Last change on this file since a07a34d was a07a34d, checked in by Thomas Trepl <thomas@…>, 4 years ago

MultiLib: Merge changes from trunk

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