source: chapter06/shadow.xml@ 22537cf

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.3 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/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 22537cf was b06ca36, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Updated book sources to use DocBook-XML DTD 4.5

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

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