source: chapter06/shadow.xml@ 0ddb173

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 6.4 6.5 6.6 6.7 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/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 0ddb173 was 0b8bbee, checked in by Jeremy Huntwork <jhuntwork@…>, 16 years ago

Two minor textual improvments

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

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