source: chapter06/shadow.xml@ e2c4848

7.5-systemd 7.6-systemd 7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since e2c4848 was e2c4848, checked in by Krejzi <krejzi@…>, 10 years ago

Updates from LFS development.

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