source: BOOK/final-system/common/shadow.xml @ 51979fc

systemd
Last change on this file since 51979fc was 51979fc, checked in by William Harrington <kb0iic@…>, 7 years ago

Update Shadow to 4.5.

  • Property mode set to 100644
File size: 18.4 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
[aa18ac0]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[3f8be484]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,
[0d4607d]30      refer to <ulink url="&cblfs-root;index.php/Cracklib"/>
[9d5637f5]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
[3f8be484]40    </note>
41
[0a6ea84]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>
[9d47629]45
[0a6ea84]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 \
[51979fc]49  -e 's/man1\/groups\.1 //' \
50  -e 's/man3\/getspnam\.3 //' \
51  -e 's/man8\/nologin\.8 //' \
52  -e 's/man5\/passwd\.5 //' '{}' \;</userinput></screen>
[9d47629]53
54    <para os="d">Prepare Shadow for compilation:</para>
[7447a2c]55
[7cd7f99]56<screen os="e"><userinput>./configure \
[51979fc]57    --sysconfdir=/etc \
58    --with-group-max-length=32</userinput></screen>
[7447a2c]59
[5861bcf]60  <variablelist os="f">
61    <title>The meaning of the new configure option:</title>
[9d47629]62
[2ae76c7c]63    <varlistentry>
64      <term><parameter>--sysconfdir=/etc</parameter></term>
65      <listitem><para>Tells Shadow to install its configuration files into
[7bca962]66      <filename class="directory">/etc</filename>, rather than
67      <filename class="directory">/usr/etc</filename>.</para></listitem>
[2ae76c7c]68    </varlistentry>
[24b004c]69
[51979fc]70    <varlistentry>
71      <term><parameter>--with-group-max-length=32</parameter></term>
72      <listitem><para>The maximum user name is 32 characters.
73      Make the maximum group name the same.</para></listitem>
74    </varlistentry>
75
[7447a2c]76  </variablelist>
77
[5861bcf]78    <para os="g">Compile the package:</para>
[3f8be484]79
[5861bcf]80<screen os="h"><userinput>make</userinput></screen>
[3f8be484]81
[5861bcf]82    <para os="i">This package does not come with a test suite.</para>
[3f8be484]83
[5861bcf]84    <para os="j">Install the package:</para>
[3f8be484]85
[5861bcf]86<screen os="k"><userinput>make install</userinput></screen>
[d1631d1]87
[5861bcf]88    <para os="l" id="shadow-login_defs">Instead of using the default
[59a3524]89    <emphasis>DES</emphasis> method, use the more secure
[51129d2]90    <emphasis>SHA512</emphasis> method of password encryption, which also allows
[3f8be484]91    passwords longer than 8 characters. It is also necessary to change the
92    obsolete <filename class="directory">/var/spool/mail</filename> location
93    for user mailboxes that Shadow uses by default to the <filename
[a1fb12f]94    class="directory">/var/mail</filename> location used currently. Use the
95    following sed command to make these changes to the appropriate
96    configuration file:</para>
[3f8be484]97
[5861bcf]98    <indexterm os="m" zone="shadow-login_defs">
[3f8be484]99      <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
100    </indexterm>
101
[5861bcf]102<screen os="n"><userinput>sed -i /etc/login.defs \
[51129d2]103    -e 's@#\(ENCRYPT_METHOD \).*@\1SHA512@' \
[38fcb2c]104    -e 's@/var/spool/mail@/var/mail@'</userinput></screen>
[81118fc]105
[5861bcf]106    <para os="o">Move a misplaced program to its proper location:</para>
[3f8be484]107
[5861bcf]108<screen os="p"><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
[3f8be484]109
[5861bcf]110    <para os="q">The <command>login</command> program will write to
[e3e2a37]111    <filename>/var/log/faillog</filename>, to record failed login attempts, and
112    <filename>/var/log/lastlog</filename>, to record the date and
113    time of the latest successful login for each user. These log files are not
114    created automatically if they do not already exist, so we will
115    create them now and give them appropriate ownership and permissions:</para>
116
[5861bcf]117<screen os="r"><userinput>touch /var/log/{fail,last}log
[e3e2a37]118chgrp -v utmp /var/log/{fail,last}log
119chmod -v 664 /var/log/{fail,last}log</userinput></screen>
[195f497]120
[3f8be484]121  </sect2>
122
123  <sect2 id="conf-shadow" role="configuration">
124    <title>Configuring Shadow</title>
125
126    <indexterm zone="conf-shadow">
127      <primary sortas="a-Shadow">Shadow</primary>
128      <secondary>configuring</secondary>
129    </indexterm>
130
131    <para>This package contains utilities to add, modify, and delete users and
132    groups; set and change their passwords; and perform other administrative
133    tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
134    means, see the <filename>doc/HOWTO</filename> file within the unpacked source
135    tree. If using Shadow support, keep in mind that programs which need to
136    verify passwords (display managers, FTP programs, pop3 daemons, etc.) must
137    be Shadow-compliant. That is, they need to be able to work with shadowed
138    passwords.</para>
139
140    <para>To enable shadowed passwords, run the following command:</para>
141
142<screen><userinput>pwconv</userinput></screen>
143
144    <para>To enable shadowed group passwords, run:</para>
145
[3a3e135]146<screen role="nodump"><userinput>grpconv</userinput></screen>
[3f8be484]147
[a1fb12f]148    <para>To view or change the default settings for new user accounts that
[d67d6bd]149    you create, you can edit <filename>/etc/default/useradd</filename>. See
[a1fb12f]150    <command>man useradd</command> or
[48770b9]151    <ulink url="&cblfs-root;index.php/Configuring_for_Adding_Users"/> for more
[a1fb12f]152    information.</para>
153
[3f8be484]154  </sect2>
155
156  <sect2 id="root-password" role="configuration">
157    <title>Setting the root password</title>
158
159    <para>Choose a password for user <systemitem
160    class="username">root</systemitem> and set it by running:</para>
161
[0f3854e]162<screen role="nodump"><userinput>passwd root</userinput></screen>
[3f8be484]163
164  </sect2>
165
166  <sect2 id="contents-shadow" role="content">
167    <title>Contents of Shadow</title>
168
169    <segmentedlist>
170      <segtitle>Installed programs</segtitle>
[61ad0b7f]171      <segtitle>Installed directory</segtitle>
[3f8be484]172
173      <seglistitem>
[d1f79ab]174        <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
[0a11182]175        groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
[0a6ea84]176        lastlog, login, logoutd, newgrp, newusers, passwd, pwck,
[0a11182]177        pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod,
[f698055a]178        vigr (link to vipw), vipw</seg>
[61ad0b7f]179        <seg>/etc/default</seg>
[3f8be484]180      </seglistitem>
181    </segmentedlist>
182
183    <variablelist>
184      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
185      <?dbfo list-presentation="list"?>
186      <?dbhtml list-presentation="table"?>
187
188      <varlistentry id="chage">
189        <term><command>chage</command></term>
190        <listitem>
191          <para>Used to change the maximum number of days between obligatory
192          password changes</para>
193          <indexterm zone="ch-system-shadow chage">
194            <primary sortas="b-chage">chage</primary>
195          </indexterm>
196        </listitem>
197      </varlistentry>
198
199      <varlistentry id="chfn">
200        <term><command>chfn</command></term>
201        <listitem>
202          <para>Used to change a user's full name and other information</para>
203          <indexterm zone="ch-system-shadow chfn">
204            <primary sortas="b-chfn">chfn</primary>
205          </indexterm>
206        </listitem>
207      </varlistentry>
208
[a68b59e]209      <varlistentry id="chgpasswd">
210        <term><command>chgpasswd</command></term>
211        <listitem>
212          <para>Used to update group passwords in batch mode</para>
213          <indexterm zone="ch-system-shadow chgpasswd">
214            <primary sortas="b-chgpasswd">chgpasswd</primary>
215          </indexterm>
216        </listitem>
217      </varlistentry>
218
[3f8be484]219      <varlistentry id="chpasswd">
220        <term><command>chpasswd</command></term>
221        <listitem>
222          <para>Used to update the passwords of an entire series of user
223          accounts</para>
224          <indexterm zone="ch-system-shadow chpasswd">
225            <primary sortas="b-chpasswd">chpasswd</primary>
226          </indexterm>
227        </listitem>
228      </varlistentry>
229
230      <varlistentry id="chsh">
231        <term><command>chsh</command></term>
232        <listitem>
233          <para>Used to change a user's default login shell</para>
234          <indexterm zone="ch-system-shadow chsh">
235            <primary sortas="b-chsh">chsh</primary>
236          </indexterm>
237        </listitem>
238      </varlistentry>
239
240      <varlistentry id="expiry">
241        <term><command>expiry</command></term>
242        <listitem>
243          <para>Checks and enforces the current password expiration policy</para>
244          <indexterm zone="ch-system-shadow expiry">
245            <primary sortas="b-expiry">expiry</primary>
246          </indexterm>
247        </listitem>
248      </varlistentry>
249
250      <varlistentry id="faillog">
251        <term><command>faillog</command></term>
252        <listitem>
253          <para>Is used to examine the log of login failures, to set a maximum
254          number of failures before an account is blocked, or to reset the
255          failure count</para>
256          <indexterm zone="ch-system-shadow faillog">
257            <primary sortas="b-faillog">faillog</primary>
258          </indexterm>
259        </listitem>
260      </varlistentry>
261
262      <varlistentry id="gpasswd">
263        <term><command>gpasswd</command></term>
264        <listitem>
265          <para>Is used to add and delete members and administrators to
266          groups</para>
267          <indexterm zone="ch-system-shadow gpasswd">
268            <primary sortas="b-gpasswd">gpasswd</primary>
269          </indexterm>
270        </listitem>
271      </varlistentry>
272
273      <varlistentry id="groupadd">
274        <term><command>groupadd</command></term>
275        <listitem>
276          <para>Creates a group with the given name</para>
277          <indexterm zone="ch-system-shadow groupadd">
278            <primary sortas="b-groupadd">groupadd</primary>
279          </indexterm>
280        </listitem>
281      </varlistentry>
282
283      <varlistentry id="groupdel">
284        <term><command>groupdel</command></term>
285        <listitem>
286          <para>Deletes the group with the given name</para>
287          <indexterm zone="ch-system-shadow groupdel">
288            <primary sortas="b-groupdel">groupdel</primary>
289          </indexterm>
290        </listitem>
291      </varlistentry>
292
[0a11182]293      <varlistentry id="groupmems">
294        <term><command>groupmems</command></term>
295        <listitem>
296          <para>Allows a user to administer his/her own group membership list
297          without the requirement of superuser privileges</para>
298          <indexterm zone="ch-system-shadow groupmems">
299            <primary sortas="b-groupmems">groupmems</primary>
300          </indexterm>
301        </listitem>
302      </varlistentry>
303
[3f8be484]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="passwd">
402        <term><command>passwd</command></term>
403        <listitem>
404          <para>Is used to change the password for a user or group account</para>
405          <indexterm zone="ch-system-shadow passwd">
406            <primary sortas="b-passwd">passwd</primary>
407          </indexterm>
408        </listitem>
409      </varlistentry>
410
411      <varlistentry id="pwck">
412        <term><command>pwck</command></term>
413        <listitem>
414          <para>Verifies the integrity of the password files
415          <filename>/etc/passwd</filename> and
416          <filename>/etc/shadow</filename></para>
417          <indexterm zone="ch-system-shadow pwck">
418            <primary sortas="b-pwck">pwck</primary>
419          </indexterm>
420        </listitem>
421      </varlistentry>
422
423      <varlistentry id="pwconv">
424        <term><command>pwconv</command></term>
425        <listitem>
426          <para>Creates or updates the shadow password file from the normal
427          password file</para>
428          <indexterm zone="ch-system-shadow pwconv">
429            <primary sortas="b-pwconv">pwconv</primary>
430          </indexterm>
431        </listitem>
432      </varlistentry>
433
434      <varlistentry id="pwunconv">
435        <term><command>pwunconv</command></term>
436        <listitem>
437          <para>Updates <filename>/etc/passwd</filename> from
438          <filename>/etc/shadow</filename> and then deletes the latter</para>
439          <indexterm zone="ch-system-shadow pwunconv">
440            <primary sortas="b-pwunconv">pwunconv</primary>
441          </indexterm>
442        </listitem>
443      </varlistentry>
444
445      <varlistentry id="sg">
446        <term><command>sg</command></term>
447        <listitem>
448          <para>Executes a given command while the user's GID
449          is set to that of the given group</para>
450          <indexterm zone="ch-system-shadow sg">
451            <primary sortas="b-sg">sg</primary>
452          </indexterm>
453        </listitem>
454      </varlistentry>
455
456      <varlistentry id="su">
457        <term><command>su</command></term>
458        <listitem>
459          <para>Runs a shell with substitute user and group IDs</para>
460          <indexterm zone="ch-system-shadow su">
461            <primary sortas="b-su">su</primary>
462          </indexterm>
463        </listitem>
464      </varlistentry>
465
466      <varlistentry id="useradd">
467        <term><command>useradd</command></term>
468        <listitem>
469          <para>Creates a new user with the given name, or updates the default
470          new-user information</para>
471          <indexterm zone="ch-system-shadow useradd">
472            <primary sortas="b-useradd">useradd</primary>
473          </indexterm>
474        </listitem>
475      </varlistentry>
476
477      <varlistentry id="userdel">
478        <term><command>userdel</command></term>
479        <listitem>
480          <para>Deletes the given user account</para>
481          <indexterm zone="ch-system-shadow userdel">
482            <primary sortas="b-userdel">userdel</primary>
483          </indexterm>
484        </listitem>
485      </varlistentry>
486
487      <varlistentry id="usermod">
488        <term><command>usermod</command></term>
489        <listitem>
490          <para>Is used to modify the given user's login name, User
491          Identification (UID), shell, initial group, home directory, etc.</para>
492          <indexterm zone="ch-system-shadow usermod">
493            <primary sortas="b-usermod">usermod</primary>
494          </indexterm>
495        </listitem>
496      </varlistentry>
497
498      <varlistentry id="vigr">
499        <term><command>vigr</command></term>
500        <listitem>
501          <para>Edits the <filename>/etc/group</filename> or
502          <filename>/etc/gshadow</filename> files</para>
503          <indexterm zone="ch-system-shadow vigr">
504            <primary sortas="b-vigr">vigr</primary>
505          </indexterm>
506        </listitem>
507      </varlistentry>
508
509      <varlistentry id="vipw">
510        <term><command>vipw</command></term>
511        <listitem>
512          <para>Edits the <filename>/etc/passwd</filename> or
513          <filename>/etc/shadow</filename> files</para>
514          <indexterm zone="ch-system-shadow vipw">
515            <primary sortas="b-vipw">vipw</primary>
516          </indexterm>
517        </listitem>
518      </varlistentry>
519
520    </variablelist>
521
522  </sect2>
523
524</sect1>
Note: See TracBrowser for help on using the repository browser.