source: chapter06/shadow.xml@ d92b5fe

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 d92b5fe was a3b689f, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Trailing spaces clean-up.

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

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