source: chapter06/shadow.xml@ 48553c1

Last change on this file since 48553c1 was ca17032, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Including patches.ent from general.ent

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

  • Property mode set to 100644
File size: 14.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/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.3 SBU</seg><seg>15.9 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>&dependencies;</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<note><para>If you would like to enforce the use of strong passwords, refer to
33<ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing Cracklib
34prior to building Shadow. Then add <parameter>--with-libcrack</parameter> to the
35<command>configure</command> command below.</para></note>
36
37<para>Apply a patch to fix a number of incorrect assumptions in Shadow's
38<command>configure</command> script:</para>
39
40<screen><userinput>patch -Np1 -i ../&shadow-configure-patch;</userinput></screen>
41
42<para>Prepare Shadow for compilation:</para>
43
44<screen><userinput>./configure --libdir=/lib --enable-shared</userinput></screen>
45
46<para>Disable the installation of the <command>groups</command> program and its man page, as Coreutils provides a better version:</para>
47
48<screen><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile
49sed -i '/groups/d' man/Makefile</userinput></screen>
50
51<para>Compile the package:</para>
52
53<screen><userinput>make</userinput></screen>
54
55<para>Install the package:</para>
56
57<screen><userinput>make install</userinput></screen>
58
59<para id="shadow-limits-login_access">Shadow uses two files to configure
60authentication settings for the system. Install these two configuration
61files:</para>
62
63<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/limits">/etc/limits</primary></indexterm>
64<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/login.access">/etc/login.access</primary></indexterm>
65
66<screen><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen>
67
68<para id="shadow-login_defs">Instead of using the default <emphasis>crypt</emphasis> method,
69use the more secure <emphasis>MD5</emphasis> method of password
70encryption, which also allows passwords longer than 8 characters. It
71is also necessary to change the obsolete <filename
72class="directory">/var/spool/mail</filename> location for user
73mailboxes that Shadow uses by default to the <filename
74class="directory">/var/mail</filename> location used currently. Both
75of these can be accomplished by changing the relevant configuration
76file while copying it to its destination:</para>
77
78<indexterm zone="shadow-login_defs"><primary sortas="e-/etc/login.defs">/etc/login.defs</primary></indexterm>
79
80<note><para>If you built Shadow with Cracklib support, insert the following into
81the <command>sed</command> given below:</para>
82
83<screen><literal>-e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@'</literal></screen>
84</note>
85
86<screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
87 -e 's@/var/spool/mail@/var/mail@' \
88 etc/login.defs &gt; /etc/login.defs</userinput></screen>
89
90<para>Move a misplaced program to its proper location:</para>
91
92<screen><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
93
94<para>Move Shadow's libraries to more appropriate locations:</para>
95
96<screen><userinput>mv -v /lib/libshadow.*a /usr/lib
97rm -v /lib/libshadow.so
98ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
99
100<para>The <parameter>-D</parameter> option of the
101<command>useradd</command> program requires the <filename
102class="directory">/etc/default</filename> directory for it to work
103properly:</para>
104
105<screen><userinput>mkdir -v /etc/default</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 role="nodump"><userinput>passwd root</userinput></screen>
149</sect2>
150
151
152<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
153
154<segmentedlist>
155<segtitle>Installed programs</segtitle>
156<segtitle>Installed libraries</segtitle>
157<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
158groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login,
159logoutd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg (link to newgrp),
160su, useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
161<seg>libshadow.[a,so]</seg>
162</seglistitem>
163</segmentedlist>
164
165<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
166<?dbfo list-presentation="list"?>
167<?dbhtml list-presentation="table"?>
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 information</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="grpck">
253<term><command>grpck</command></term>
254<listitem>
255<para>Verifies the integrity of the group files <filename>/etc/group</filename>
256and <filename>/etc/gshadow</filename></para>
257<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
258</listitem>
259</varlistentry>
260
261<varlistentry id="grpconv">
262<term><command>grpconv</command></term>
263<listitem>
264<para>Creates or updates the shadow group file from the normal group file</para>
265<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
266</listitem>
267</varlistentry>
268
269<varlistentry id="grpunconv">
270<term><command>grpunconv</command></term>
271<listitem>
272<para>Updates <filename>/etc/group</filename>
273from <filename>/etc/gshadow</filename> and then deletes the latter</para>
274<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
275</listitem>
276</varlistentry>
277
278<varlistentry id="lastlog">
279<term><command>lastlog</command></term>
280<listitem>
281<para>Reports the most recent login of all users or of a given user</para>
282<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
283</listitem>
284</varlistentry>
285
286<varlistentry id="login">
287<term><command>login</command></term>
288<listitem>
289<para>Is used by the system to let users sign on</para>
290<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
291</listitem>
292</varlistentry>
293
294<varlistentry id="logoutd">
295<term><command>logoutd</command></term>
296<listitem>
297<para>Is a daemon used to enforce restrictions on log-on time and ports</para>
298<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
299</listitem>
300</varlistentry>
301
302<varlistentry id="newgrp">
303<term><command>newgrp</command></term>
304<listitem>
305<para>Is used to change the current GID during a login session</para>
306<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
307</listitem>
308</varlistentry>
309
310<varlistentry id="newusers">
311<term><command>newusers</command></term>
312<listitem>
313<para>Is used to create or update an entire series of user accounts</para>
314<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
315</listitem>
316</varlistentry>
317
318<varlistentry id="passwd">
319<term><command>passwd</command></term>
320<listitem>
321<para>Is used to change the password for a user or group account</para>
322<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
323</listitem>
324</varlistentry>
325
326<varlistentry id="pwck">
327<term><command>pwck</command></term>
328<listitem>
329<para>Verifies the integrity of the password files
330<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename></para>
331<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
332</listitem>
333</varlistentry>
334
335<varlistentry id="pwconv">
336<term><command>pwconv</command></term>
337<listitem>
338<para>Creates or updates the shadow password file from the normal
339password file</para>
340<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
341</listitem>
342</varlistentry>
343
344<varlistentry id="pwunconv">
345<term><command>pwunconv</command></term>
346<listitem>
347<para>Updates <filename>/etc/passwd</filename>
348from <filename>/etc/shadow</filename> and then deletes the latter</para>
349<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
350</listitem>
351</varlistentry>
352
353<varlistentry id="sg">
354<term><command>sg</command></term>
355<listitem>
356<para>Executes a given command while the user's GID
357is set to that of the given group</para>
358<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
359</listitem>
360</varlistentry>
361
362<varlistentry id="su">
363<term><command>su</command></term>
364<listitem>
365<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
366<para>Runs a shell with substitute user and group IDs</para>
367</listitem>
368</varlistentry>
369
370<varlistentry id="useradd">
371<term><command>useradd</command></term>
372<listitem>
373<para>Creates a new user with the given name, or updates the default
374new-user information</para>
375<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
376</listitem>
377</varlistentry>
378
379<varlistentry id="userdel">
380<term><command>userdel</command></term>
381<listitem>
382<para>Deletes the given user account</para>
383<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
384</listitem>
385</varlistentry>
386
387<varlistentry id="usermod">
388<term><command>usermod</command></term>
389<listitem>
390<para>Is used to modify the given user's login name, User
391Identification (UID),
392shell, initial group, home directory, etc.</para>
393<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
394</listitem>
395</varlistentry>
396
397<varlistentry id="vigr">
398<term><command>vigr</command></term>
399<listitem>
400<para>Edits the <filename>/etc/group</filename> or
401<filename>/etc/gshadow</filename> files</para>
402<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
403</listitem>
404</varlistentry>
405
406<varlistentry id="vipw">
407<term><command>vipw</command></term>
408<listitem>
409<para>Edits the <filename>/etc/passwd</filename> or
410<filename>/etc/shadow</filename> files</para>
411<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
412</listitem>
413</varlistentry>
414
415<varlistentry id="libshadow">
416<term><filename class="libraryfile">libshadow</filename></term>
417<listitem>
418<para>Contains functions used by most programs in this package</para>
419<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
420</listitem>
421</varlistentry>
422</variablelist>
423
424</sect2>
425
426</sect1>
427
Note: See TracBrowser for help on using the repository browser.