source: clfs-sysroot/BOOK/final-system/common/shadow.xml @ 3349a3a

Last change on this file since 3349a3a was 3349a3a, checked in by Jim Gifford <clfs@…>, 18 years ago

r3669@server (orig r1667): jciccone | 2006-05-27 18:13:38 -0700
Various text and command fixes

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