source: chapter06/shadow.xml@ a75acee

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

Fixed a typo in my last commint.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4249 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 15.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-shadow" role="wrap">
7<title>Shadow-&shadow-version;</title>
8<?dbhtml filename="shadow.html"?>
9
10<indexterm zone="ch-system-shadow"><primary sortas="a-Shadow">Shadow</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Shadow package contains programs for handling passwords in a secure
14way.</para>
15
16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>0.4 SBU</seg><seg>11 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>Shadow installation depends on</segtitle>
24<seglistitem><seg>Bash, Binutils, Bison, Coreutils,
25Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem>
26</segmentedlist>
27</sect2>
28
29<sect2 role="installation">
30<title>Installation of Shadow</title>
31
32<para>Prepare Shadow for compilation:</para>
33
34<screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
35
36<para>Work around a problem that prevents Shadow's
37internationalization from working:</para>
38
39<screen><userinput>echo '#define HAVE_SETLOCALE 1' &gt;&gt; config.h</userinput></screen>
40
41<para>Shadow incorrectly declares the malloc() function, causing
42compilation failure. Fix this:</para>
43
44<screen><userinput>sed -i '/extern char/d' libmisc/xmalloc.c</userinput></screen>
45
46<para>Compile the package:</para>
47
48<screen><userinput>make</userinput></screen>
49
50<para>Install the package:</para>
51
52<screen><userinput>make install</userinput></screen>
53
54<para id="shadow-limits-login_access">Shadow uses two files to configure
55authentication settings for the system. Install these two config files:</para>
56
57<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/limits">/etc/limits</primary></indexterm>
58<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/login.access">/etc/login.access</primary></indexterm>
59
60<screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
61
62<beginpage/>
63<para id="shadow-login_defs">Instead of using the default <emphasis>crypt</emphasis> method,
64use the more secure <emphasis>MD5</emphasis> method of password
65encryption, which also allows passwords longer than 8 characters. It
66is also necessary to change the obsolete <filename
67class="directory">/var/spool/mail</filename> location for user
68mailboxes that Shadow uses by default to the <filename
69class="directory">/var/mail</filename> location used currently. Both
70of these can be accomplished by changing the relevant configuration
71file while copying it to its destination:</para>
72
73<indexterm zone="shadow-login_defs"><primary sortas="e-/etc/login.defs">/etc/login.defs</primary></indexterm>
74
75<screen><userinput>cp etc/login.defs.linux /etc/login.defs
76sed -i -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
77 -e 's@/var/spool/mail@/var/mail@' /etc/login.defs</userinput></screen>
78
79<para>Move some misplaced symlinks/programs to their proper
80locations:</para>
81
82<screen><userinput>mv /bin/sg /usr/bin
83mv /bin/vigr /usr/sbin
84mv /usr/bin/passwd /bin</userinput></screen>
85
86<para>Move Shadow's dynamic libraries to a more appropriate
87location:</para>
88
89<screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
90
91<para>Because some packages expect to find the just-moved libraries in
92<filename class="directory">/usr/lib</filename>, create the following
93symlinks:</para>
94
95<screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
96ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
97
98<para>The <parameter>-D</parameter> option of the
99<command>useradd</command> program requires the <filename
100class="directory">/etc/default</filename> directory for it to work
101properly:</para>
102
103<screen><userinput>mkdir /etc/default</userinput></screen>
104
105<para>Coreutils has already installed a better
106<command>groups</command> program in <filename
107class="directory">/usr/bin</filename>. Remove the one installed by
108Shadow:</para>
109
110<screen><userinput>rm /bin/groups</userinput></screen>
111
112</sect2>
113
114
115<sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
116<indexterm zone="conf-shadow">
117<primary sortas="a-Shadow">Shadow</primary>
118<secondary>configuring</secondary></indexterm>
119
120<para>This package contains utilities to add, modify, and delete users
121and groups; set and change their passwords; and perform other
122administrative tasks. For a full explanation of what
123<emphasis>password shadowing</emphasis> means, see the
124<filename>doc/HOWTO</filename> file within the unpacked source tree.
125If using Shadow support, keep in mind that programs which need to
126verify passwords (display managers, FTP programs, pop3 daemons, etc.)
127must be shadow-compliant. That is, they need to be able to work with
128shadowed 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><userinput>grpconv</userinput></screen>
137
138<para>Under normal circumstances, passwords will not have been created
139yet. However, if returning to this section later to enable shadowing,
140reset any current user passwords with the <command>passwd</command>
141command or any group passwords with the <command>gpasswd</command>
142command.</para>
143
144</sect2>
145
146
147<sect2 role="configuration">
148<title>Setting the root password</title>
149
150<para>Choose a password for user <emphasis>root</emphasis> and set it
151by running:</para>
152
153<screen><userinput>passwd root</userinput></screen>
154
155</sect2>
156
157
158<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
159
160<segmentedlist>
161<segtitle>Installed programs</segtitle>
162<segtitle>Installed libraries</segtitle>
163<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
164groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login,
165logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg
166(link to newgrp), useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
167<seg>libshadow[.a,so]</seg>
168</seglistitem>
169</segmentedlist>
170
171<variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
172<?dbfo list-presentation="list"?>
173
174<varlistentry id="chage">
175<term><command>chage</command></term>
176<listitem>
177<para> used to change the maximum number of days between obligatory
178password changes.</para>
179<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
180</listitem>
181</varlistentry>
182
183<varlistentry id="chfn">
184<term><command>chfn</command></term>
185<listitem>
186<para>used to change a user's full name and other info.</para>
187<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
188</listitem>
189</varlistentry>
190
191<varlistentry id="chpasswd">
192<term><command>chpasswd</command></term>
193<listitem>
194<para>used to update the passwords of an entire series of user
195accounts.</para>
196<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
197</listitem>
198</varlistentry>
199
200<varlistentry id="chsh">
201<term><command>chsh</command></term>
202<listitem>
203<para>used to change a user's default login shell.</para>
204<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
205</listitem>
206</varlistentry>
207
208<varlistentry id="expiry">
209<term><command>expiry</command></term>
210<listitem>
211<para>checks and enforces the current password expiration policy.</para>
212<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
213</listitem>
214</varlistentry>
215
216<varlistentry id="faillog">
217<term><command>faillog</command></term>
218<listitem>
219<para>is used to examine the log of login failures, to set a maximum number of
220failures before an account is blocked, or to reset the failure count.</para>
221<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
222</listitem>
223</varlistentry>
224
225<varlistentry id="gpasswd">
226<term><command>gpasswd</command></term>
227<listitem>
228<para>is used to add and delete members and administrators to groups.</para>
229<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
230</listitem>
231</varlistentry>
232
233<varlistentry id="groupadd">
234<term><command>groupadd</command></term>
235<listitem>
236<para>creates a group with the given name.</para>
237<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
238</listitem>
239</varlistentry>
240
241<varlistentry id="groupdel">
242<term><command>groupdel</command></term>
243<listitem>
244<para>deletes the group with the given name.</para>
245<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
246</listitem>
247</varlistentry>
248
249<varlistentry id="groupmod">
250<term><command>groupmod</command></term>
251<listitem>
252<para>is used to modify the given group's name or GID.</para>
253<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
254</listitem>
255</varlistentry>
256
257<varlistentry id="groups">
258<term><command>groups</command></term>
259<listitem>
260<para>reports the groups of which the given users are members.</para>
261<indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
262</listitem>
263</varlistentry>
264
265<varlistentry id="grpck">
266<term><command>grpck</command></term>
267<listitem>
268<para>verifies the integrity of the group files <filename>/etc/group</filename>
269and <filename>/etc/gshadow</filename>.</para>
270<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
271</listitem>
272</varlistentry>
273
274<varlistentry id="grpconv">
275<term><command>grpconv</command></term>
276<listitem>
277<para>creates or updates the shadow group file from the normal group file.</para>
278<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
279</listitem>
280</varlistentry>
281
282<varlistentry id="grpunconv">
283<term><command>grpunconv</command></term>
284<listitem>
285<para>updates <filename>/etc/group</filename>
286from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
287<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
288</listitem>
289</varlistentry>
290
291<varlistentry id="lastlog">
292<term><command>lastlog</command></term>
293<listitem>
294<para>reports the most recent login of all users or of a given user.</para>
295<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
296</listitem>
297</varlistentry>
298
299<varlistentry id="login">
300<term><command>login</command></term>
301<listitem>
302<para>is used by the system to let users sign on.</para>
303<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
304</listitem>
305</varlistentry>
306
307<varlistentry id="logoutd">
308<term><command>logoutd</command></term>
309<listitem>
310<para>is a daemon used to enforce restrictions on log-on time and ports.</para>
311<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
312</listitem>
313</varlistentry>
314
315<varlistentry id="mkpasswd">
316<term><command>mkpasswd</command></term>
317<listitem>
318<para>generates random passwords.</para>
319<indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
320</listitem>
321</varlistentry>
322
323<varlistentry id="newgrp">
324<term><command>newgrp</command></term>
325<listitem>
326<para>is used to change the current GID during a login session.</para>
327<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
328</listitem>
329</varlistentry>
330
331<varlistentry id="newusers">
332<term><command>newusers</command></term>
333<listitem>
334<para>is used to create or update an entire series of user accounts.</para>
335<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
336</listitem>
337</varlistentry>
338
339<varlistentry id="passwd">
340<term><command>passwd</command></term>
341<listitem>
342<para>is used to change the password for a user or group account.</para>
343<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
344</listitem>
345</varlistentry>
346
347<varlistentry id="pwck">
348<term><command>pwck</command></term>
349<listitem>
350<para>verifies the integrity of the password files
351<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
352<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
353</listitem>
354</varlistentry>
355
356<varlistentry id="pwconv">
357<term><command>pwconv</command></term>
358<listitem>
359<para>creates or updates the shadow password file from the normal
360password file.</para>
361<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
362</listitem>
363</varlistentry>
364
365<varlistentry id="pwunconv">
366<term><command>pwunconv</command></term>
367<listitem>
368<para>updates <filename>/etc/passwd</filename>
369from <filename>/etc/shadow</filename> and then deletes the latter.</para>
370<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
371</listitem>
372</varlistentry>
373
374<varlistentry id="sg">
375<term><command>sg</command></term>
376<listitem>
377<para>executes a given command while the user's GID
378is set to that of the given group.</para>
379<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
380</listitem>
381</varlistentry>
382
383<varlistentry id="su">
384<term><command>su</command></term>
385<listitem>
386<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
387<para>runs a shell with substitute user and group IDs.</para>
388</listitem>
389</varlistentry>
390
391<varlistentry id="useradd">
392<term><command>useradd</command></term>
393<listitem>
394<para>creates a new user with the given name, or updates the default
395new-user information.</para>
396<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
397</listitem>
398</varlistentry>
399
400<varlistentry id="userdel">
401<term><command>userdel</command></term>
402<listitem>
403<para>deletes the given user account.</para>
404<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
405</listitem>
406</varlistentry>
407
408<varlistentry id="usermod">
409<term><command>usermod</command></term>
410<listitem>
411<para>is used to modify the given user's login name, User
412Identification (UID),
413shell, initial group, home directory, etc.</para>
414<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
415</listitem>
416</varlistentry>
417
418<varlistentry id="vigr">
419<term><command>vigr</command></term>
420<listitem>
421<para>edits the <filename>/etc/group</filename> or
422<filename>/etc/gshadow</filename> files.</para>
423<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
424</listitem>
425</varlistentry>
426
427<varlistentry id="vipw">
428<term><command>vipw</command></term>
429<listitem>
430<para>edits the <filename>/etc/passwd</filename> or
431<filename>/etc/shadow</filename> files.</para>
432<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
433</listitem>
434</varlistentry>
435
436<varlistentry id="libshadow">
437<term><filename class="libraryfile">libshadow</filename></term>
438<listitem>
439<para>contains functions used by most programs in this package.</para>
440<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
441</listitem>
442</varlistentry>
443</variablelist>
444
445</sect2>
446
447</sect1>
448
Note: See TracBrowser for help on using the repository browser.