source: BOOK/final-system/common/shadow.xml @ 3accd6a

sysvinit
Last change on this file since 3accd6a was 3accd6a, checked in by William Harrington <kb0iic@…>, 5 years ago

Remove separate para with title before variable list and add title within variablelist as reported by Michio Matsuyama at the CLFS-Dev mailing list.

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