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

Last change on this file since cc8d737 was cc8d737, checked in by Joe Ciccone <jciccone@…>, 15 years ago

Use cat instead of echo wherever possible.

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