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

Last change on this file since a074923 was a074923, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Some fixes for PDF look.

  • 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  <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="p1">The following patch fixes an issue in useradd, where it only
37    accepts group names, not group id numbers:</para>
38
39<screen os="p2"><userinput>patch -Np1 -i ../&shadow-useradd_fix-patch;</userinput></screen>
40
41    <para os="b">Create a config.cache containing information about a test that
42    cannot be run when cross-compiling:</para>
43
44<screen os="c"><userinput>echo "ac_cv_func_setpgrp_void=yes" &gt; config.cache</userinput></screen>
45
46    <para os="d">Prepare Shadow for compilation:</para>
47
48<screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
49    --libdir=/lib --sysconfdir=/etc --enable-shared \
50    --without-libpam --without-audit --without-selinux \
51    --cache-file=config.cache</userinput></screen>
52
53<para os="f">The meaning of the configure options:</para>
54
55  <variablelist os="g">
56    <varlistentry>
57      <term><parameter>--sysconfdir=/etc</parameter></term>
58      <listitem><para>Tells Shadow to install its configuration files into
59      /etc, rather than /usr/etc.</para></listitem>
60    </varlistentry>
61    <varlistentry>
62      <term><parameter>--without-libpam</parameter></term>
63      <listitem><para>Support for Linux-PAM is enabled by default in Shadow,
64      however PAM is not installed on a base CLFS system, so this switch
65      disables PAM support in Shadow. For instructions to install PAM and
66      link Shadow to it, you can look at
67      <ulink url="&blfs-root;view/svn/postlfs/shadow.html"/>.</para></listitem>
68    </varlistentry>
69    <varlistentry>
70      <term><parameter>--without-audit</parameter></term>
71      <listitem><para>Support for auditing is enabled by default, but a
72      library that it needs is not installed in a base CLFS system. This
73      switch disables auditing support.</para></listitem>
74    </varlistentry>
75    <varlistentry>
76      <term><parameter>--without-selinux</parameter></term>
77      <listitem><para>Support for selinux is enabled by default, but selinux
78      is not built in a base CLFS system and configure will fail without this
79      switch.</para></listitem>
80    </varlistentry>
81  </variablelist>
82
83    <para os="h">Disable the installation of the <command>groups</command>
84    program and its man pages, as Coreutils provides a better version:</para>
85
86<screen os="i"><userinput>cp src/Makefile{,.orig}
87sed 's/groups$(EXEEXT) //' src/Makefile.orig &gt; src/Makefile
88cp man/Makefile{,.orig}
89sed -e '/groups1.xml/d' \
90    -e 's/groups.1//' man/Makefile.orig &gt; man/Makefile</userinput></screen>
91
92    <para os="j">Compile the package:</para>
93
94<screen os="k"><userinput>make</userinput></screen>
95
96    <para os="l">Install the package:</para>
97
98<screen os="m"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
99
100    <para id="shadow-login_defs" os="r">Instead of using the default
101    <emphasis>crypt</emphasis> method, use the more secure
102    <emphasis>MD5</emphasis> method of password encryption, which also allows
103    passwords longer than 8 characters. It is also necessary to change the
104    obsolete <filename class="directory">/var/spool/mail</filename> location
105    for user mailboxes that Shadow uses by default to the <filename
106    class="directory">/var/mail</filename> location used currently. Use the
107    following sed command to make these changes to the appropriate
108    configuration file:</para>
109
110    <indexterm zone="shadow-login_defs" os="s">
111      <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
112    </indexterm>
113
114<screen os="t"><userinput>cp ${CLFS}/etc/login.defs login.defs.orig
115sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
116    -e 's@/var/spool/mail@/var/mail@' \
117    login.defs.orig &gt; ${CLFS}/etc/login.defs</userinput></screen>
118
119    <note os="u">
120      <para>If you built Shadow with Cracklib support, execute
121      this <command>sed</command> to correct the path to the Cracklib
122      dictionary:</para>
123
124<screen role="nodump"><userinput>cp ${CLFS}/etc/login.defs login.defs.orig
125sed 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' login.defs.orig \
126    &gt; ${CLFS}/etc/login.defs</userinput></screen>
127    </note>
128
129    <para os="v">Move a misplaced program to its proper location:</para>
130
131<screen os="w"><userinput>mv -v ${CLFS}/usr/bin/passwd ${CLFS}/bin</userinput></screen>
132
133    <para os="x">Move Shadow's static and dynamic libraries to a more
134    appropriate location:</para>
135
136<screen os="y"><userinput>mv -v ${CLFS}/lib/libshadow.*a ${CLFS}/usr/lib
137rm -v ${CLFS}/lib/libshadow.so
138ln -svf ../../lib/libshadow.so.0 ${CLFS}/usr/lib/libshadow.so</userinput></screen>
139
140  </sect2>
141
142  <sect2 id="conf-shadow" role="configuration">
143    <title>Configuring Shadow</title>
144
145    <indexterm zone="conf-shadow">
146      <primary sortas="a-Shadow">Shadow</primary>
147      <secondary>configuring</secondary>
148    </indexterm>
149
150    <para>This package contains utilities to add, modify, and delete users and
151    groups; set and change their passwords; and perform other administrative
152    tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
153    means, see the <filename>doc/HOWTO</filename> file within the unpacked source
154    tree. If using Shadow support, keep in mind that programs which need to
155    verify passwords (display managers, FTP programs, pop3 daemons, etc.) must
156    be Shadow-compliant. That is, they need to be able to work with shadowed
157    passwords.</para>
158
159    <para>To enable shadowed passwords, run the following command:</para>
160
161<screen role="nodump"><userinput>${CLFS_TARGET}-pwconv</userinput></screen>
162
163    <para>To enable shadowed group passwords, run:</para>
164
165<screen role="nodump"><userinput>${CLFS_TARGET}-grpconv</userinput></screen>
166
167    <para>To view or change the default settings for new user accounts that
168    you create, you can edit <filename>/etc/default/useradd</filename>. See
169    <command>man useradd</command> or
170    <ulink url="&blfs-root;view/svn/postlfs/skel.html"/> for more
171    information.</para>
172
173  </sect2>
174
175  <sect2 id="root-password" role="configuration">
176    <title>Setting the root password</title>
177
178    <para>Choose a password for user <systemitem
179    class="username">root</systemitem> and set it by running:</para>
180
181<screen role="nodump"><userinput>${CLFS_TARGET}-passwd root</userinput></screen>
182
183  </sect2>
184
185  <sect2 id="contents-shadow" role="content">
186    <title>Contents of Shadow</title>
187
188    <segmentedlist>
189      <segtitle>Installed programs</segtitle>
190      <segtitle>Installed libraries</segtitle>
191
192      <seglistitem>
193        <seg>chage, chfn, chpasswd, chgpasswd, chsh, expiry, faillog, gpasswd,
194        groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog,
195        login, logoutd, newgrp, newusers, nologin, passwd, pwck, pwconv,
196        pwunconv, sg (link to newgrp), useradd, userdel, usermod,
197        vigr (link to vipw), and vipw</seg>
198        <seg>libshadow.[a,so]</seg>
199      </seglistitem>
200    </segmentedlist>
201
202    <variablelist>
203      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
204      <?dbfo list-presentation="list"?>
205      <?dbhtml list-presentation="table"?>
206
207      <varlistentry id="chage">
208        <term><command>chage</command></term>
209        <listitem>
210          <para>Used to change the maximum number of days between obligatory
211          password changes</para>
212          <indexterm zone="ch-system-shadow chage">
213            <primary sortas="b-chage">chage</primary>
214          </indexterm>
215        </listitem>
216      </varlistentry>
217
218      <varlistentry id="chfn">
219        <term><command>chfn</command></term>
220        <listitem>
221          <para>Used to change a user's full name and other information</para>
222          <indexterm zone="ch-system-shadow chfn">
223            <primary sortas="b-chfn">chfn</primary>
224          </indexterm>
225        </listitem>
226      </varlistentry>
227
228      <varlistentry id="chgpasswd">
229        <term><command>chgpasswd</command></term>
230        <listitem>
231          <para>Used to update group passwords in batch mode</para>
232          <indexterm zone="ch-system-shadow chgpasswd">
233            <primary sortas="b-chgpasswd">chgpasswd</primary>
234          </indexterm>
235        </listitem>
236      </varlistentry>
237
238      <varlistentry id="chpasswd">
239        <term><command>chpasswd</command></term>
240        <listitem>
241          <para>Used to update the passwords of an entire series of user
242          accounts</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="groupmod">
313        <term><command>groupmod</command></term>
314        <listitem>
315          <para>Is used to modify the given group's name or GID</para>
316          <indexterm zone="ch-system-shadow groupmod">
317            <primary sortas="b-groupmod">groupmod</primary>
318          </indexterm>
319        </listitem>
320      </varlistentry>
321
322      <varlistentry id="grpck">
323        <term><command>grpck</command></term>
324        <listitem>
325          <para>Verifies the integrity of the group files
326          <filename>/etc/group</filename> and
327          <filename>/etc/gshadow</filename></para>
328          <indexterm zone="ch-system-shadow grpck">
329            <primary sortas="b-grpck">grpck</primary>
330          </indexterm>
331        </listitem>
332      </varlistentry>
333
334      <varlistentry id="grpconv">
335        <term><command>grpconv</command></term>
336        <listitem>
337          <para>Creates or updates the shadow group file from the normal
338          group file</para>
339          <indexterm zone="ch-system-shadow grpconv">
340            <primary sortas="b-grpconv">grpconv</primary>
341          </indexterm>
342        </listitem>
343      </varlistentry>
344
345      <varlistentry id="grpunconv">
346        <term><command>grpunconv</command></term>
347        <listitem>
348          <para>Updates <filename>/etc/group</filename> from
349          <filename>/etc/gshadow</filename> and then deletes the latter</para>
350          <indexterm zone="ch-system-shadow grpunconv">
351            <primary sortas="b-grpunconv">grpunconv</primary>
352          </indexterm>
353        </listitem>
354      </varlistentry>
355
356      <varlistentry id="lastlog">
357        <term><command>lastlog</command></term>
358        <listitem>
359          <para>Reports the most recent login of all users or of a
360          given user</para>
361          <indexterm zone="ch-system-shadow lastlog">
362            <primary sortas="b-lastlog">lastlog</primary>
363          </indexterm>
364        </listitem>
365      </varlistentry>
366
367      <varlistentry id="login">
368        <term><command>login</command></term>
369        <listitem>
370          <para>Is used by the system to let users sign on</para>
371          <indexterm zone="ch-system-shadow login">
372            <primary sortas="b-login">login</primary>
373          </indexterm>
374        </listitem>
375      </varlistentry>
376
377      <varlistentry id="logoutd">
378        <term><command>logoutd</command></term>
379        <listitem>
380          <para>Is a daemon used to enforce restrictions on log-on time
381          and ports</para>
382          <indexterm zone="ch-system-shadow logoutd">
383            <primary sortas="b-logoutd">logoutd</primary>
384          </indexterm>
385        </listitem>
386      </varlistentry>
387
388      <varlistentry id="newgrp">
389        <term><command>newgrp</command></term>
390        <listitem>
391          <para>Is used to change the current GID during a login session</para>
392          <indexterm zone="ch-system-shadow newgrp">
393            <primary sortas="b-newgrp">newgrp</primary>
394          </indexterm>
395        </listitem>
396      </varlistentry>
397
398      <varlistentry id="newusers">
399        <term><command>newusers</command></term>
400        <listitem>
401          <para>Is used to create or update an entire series of user
402          accounts</para>
403          <indexterm zone="ch-system-shadow newusers">
404            <primary sortas="b-newusers">newusers</primary>
405          </indexterm>
406        </listitem>
407      </varlistentry>
408
409      <varlistentry id="nologin">
410        <term><command>nologin</command></term>
411        <listitem>
412          <para>Displays a message that an account is not available. Designed
413          to be used as the default shell for accounts that have been
414          disabled</para>
415          <indexterm zone="ch-system-shadow nologin">
416            <primary sortas="b-nologin">nologin</primary>
417          </indexterm>
418        </listitem>
419      </varlistentry>
420
421      <varlistentry id="passwd">
422        <term><command>passwd</command></term>
423        <listitem>
424          <para>Is used to change the password for a user or group account</para>
425          <indexterm zone="ch-system-shadow passwd">
426            <primary sortas="b-passwd">passwd</primary>
427          </indexterm>
428        </listitem>
429      </varlistentry>
430
431      <varlistentry id="pwck">
432        <term><command>pwck</command></term>
433        <listitem>
434          <para>Verifies the integrity of the password files
435          <filename>/etc/passwd</filename> and
436          <filename>/etc/shadow</filename></para>
437          <indexterm zone="ch-system-shadow pwck">
438            <primary sortas="b-pwck">pwck</primary>
439          </indexterm>
440        </listitem>
441      </varlistentry>
442
443      <varlistentry id="pwconv">
444        <term><command>pwconv</command></term>
445        <listitem>
446          <para>Creates or updates the shadow password file from the normal
447          password file</para>
448          <indexterm zone="ch-system-shadow pwconv">
449            <primary sortas="b-pwconv">pwconv</primary>
450          </indexterm>
451        </listitem>
452      </varlistentry>
453
454      <varlistentry id="pwunconv">
455        <term><command>pwunconv</command></term>
456        <listitem>
457          <para>Updates <filename>/etc/passwd</filename> from
458          <filename>/etc/shadow</filename> and then deletes the latter</para>
459          <indexterm zone="ch-system-shadow pwunconv">
460            <primary sortas="b-pwunconv">pwunconv</primary>
461          </indexterm>
462        </listitem>
463      </varlistentry>
464
465      <varlistentry id="sg">
466        <term><command>sg</command></term>
467        <listitem>
468          <para>Executes a given command while the user's GID
469          is set to that of the given group</para>
470          <indexterm zone="ch-system-shadow sg">
471            <primary sortas="b-sg">sg</primary>
472          </indexterm>
473        </listitem>
474      </varlistentry>
475
476      <varlistentry id="su">
477        <term><command>su</command></term>
478        <listitem>
479          <para>Runs a shell with substitute user and group IDs</para>
480          <indexterm zone="ch-system-shadow su">
481            <primary sortas="b-su">su</primary>
482          </indexterm>
483        </listitem>
484      </varlistentry>
485
486      <varlistentry id="useradd">
487        <term><command>useradd</command></term>
488        <listitem>
489          <para>Creates a new user with the given name, or updates the default
490          new-user information</para>
491          <indexterm zone="ch-system-shadow useradd">
492            <primary sortas="b-useradd">useradd</primary>
493          </indexterm>
494        </listitem>
495      </varlistentry>
496
497      <varlistentry id="userdel">
498        <term><command>userdel</command></term>
499        <listitem>
500          <para>Deletes the given user account</para>
501          <indexterm zone="ch-system-shadow userdel">
502            <primary sortas="b-userdel">userdel</primary>
503          </indexterm>
504        </listitem>
505      </varlistentry>
506
507      <varlistentry id="usermod">
508        <term><command>usermod</command></term>
509        <listitem>
510          <para>Is used to modify the given user's login name, User
511          Identification (UID), shell, initial group, home directory, etc.</para>
512          <indexterm zone="ch-system-shadow usermod">
513            <primary sortas="b-usermod">usermod</primary>
514          </indexterm>
515        </listitem>
516      </varlistentry>
517
518      <varlistentry id="vigr">
519        <term><command>vigr</command></term>
520        <listitem>
521          <para>Edits the <filename>/etc/group</filename> or
522          <filename>/etc/gshadow</filename> files</para>
523          <indexterm zone="ch-system-shadow vigr">
524            <primary sortas="b-vigr">vigr</primary>
525          </indexterm>
526        </listitem>
527      </varlistentry>
528
529      <varlistentry id="vipw">
530        <term><command>vipw</command></term>
531        <listitem>
532          <para>Edits the <filename>/etc/passwd</filename> or
533          <filename>/etc/shadow</filename> files</para>
534          <indexterm zone="ch-system-shadow vipw">
535            <primary sortas="b-vipw">vipw</primary>
536          </indexterm>
537        </listitem>
538      </varlistentry>
539
540      <varlistentry id="libshadow">
541        <term><filename class="libraryfile">libshadow</filename></term>
542        <listitem>
543          <para>Contains functions used by most programs in this package</para>
544          <indexterm zone="ch-system-shadow libshadow">
545            <primary sortas="c-libshadow">libshadow</primary>
546          </indexterm>
547        </listitem>
548      </varlistentry>
549
550    </variablelist>
551
552  </sect2>
553
554</sect1>
Note: See TracBrowser for help on using the repository browser.