source: chapter06/shadow.xml@ 38bb44a

6.0
Last change on this file since 38bb44a was 38bb44a, checked in by Gerard Beekmans <gerard@…>, 20 years ago

first round of printed layout fixes

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

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