source: chapter06/shadow.xml@ c851a9a

6.1 6.1.1
Last change on this file since c851a9a was c851a9a, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

PDF fixes in chapter06, last set.

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

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