source: chapter06/shadow.xml@ b29ecf0

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

Ported r4909 from trunk: Tags corrections.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.1/BOOK@4910 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<para>Move Shadow's libraries to more appropriate locations:</para>
87
88<screen><userinput>mv /lib/libshadow.*a /usr/lib
89rm /lib/libshadow.so
90ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
91
92<para>The <parameter>-D</parameter> option of the
93<command>useradd</command> program requires the <filename
94class="directory">/etc/default</filename> directory for it to work
95properly:</para>
96
97<screen><userinput>mkdir /etc/default</userinput></screen>
98
99</sect2>
100
101
102<sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
103<indexterm zone="conf-shadow">
104<primary sortas="a-Shadow">Shadow</primary>
105<secondary>configuring</secondary></indexterm>
106
107<para>This package contains utilities to add, modify, and delete users
108and groups; set and change their passwords; and perform other
109administrative tasks. For a full explanation of what
110<emphasis>password shadowing</emphasis> means, see the
111<filename>doc/HOWTO</filename> file within the unpacked source tree.
112If using Shadow support, keep in mind that programs which need to
113verify passwords (display managers, FTP programs, pop3 daemons, etc.)
114must be shadow-compliant. That is, they need to be able to work with
115shadowed passwords.</para>
116
117<para>To enable shadowed passwords, run the following command:</para>
118
119<screen><userinput>pwconv</userinput></screen>
120
121<para>To enable shadowed group passwords, run:</para>
122
123<screen><userinput>grpconv</userinput></screen>
124
125<para>Under normal circumstances, passwords will not have been created
126yet. However, if returning to this section later to enable shadowing,
127reset any current user passwords with the <command>passwd</command>
128command or any group passwords with the <command>gpasswd</command>
129command.</para>
130
131</sect2>
132
133
134<sect2 role="configuration">
135<title>Setting the root password</title>
136
137<para>Choose a password for user <emphasis>root</emphasis> and set it
138by running:</para>
139
140<screen><userinput>passwd root</userinput></screen>
141</sect2>
142
143
144<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
145
146<segmentedlist>
147<segtitle>Installed programs</segtitle>
148<segtitle>Installed libraries</segtitle>
149<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
150groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login,
151logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg
152(link to newgrp), useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
153<seg>libshadow[.a,so]</seg>
154</seglistitem>
155</segmentedlist>
156
157<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
158<?dbfo list-presentation="list"?>
159<?dbhtml list-presentation="table"?>
160
161<varlistentry id="chage">
162<term><command>chage</command></term>
163<listitem>
164<para>Used to change the maximum number of days between obligatory
165password changes</para>
166<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
167</listitem>
168</varlistentry>
169
170<varlistentry id="chfn">
171<term><command>chfn</command></term>
172<listitem>
173<para>Used to change a user's full name and other info</para>
174<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
175</listitem>
176</varlistentry>
177
178<varlistentry id="chpasswd">
179<term><command>chpasswd</command></term>
180<listitem>
181<para>Used to update the passwords of an entire series of user
182accounts</para>
183<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
184</listitem>
185</varlistentry>
186
187<varlistentry id="chsh">
188<term><command>chsh</command></term>
189<listitem>
190<para>Used to change a user's default login shell</para>
191<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
192</listitem>
193</varlistentry>
194
195<varlistentry id="expiry">
196<term><command>expiry</command></term>
197<listitem>
198<para>Checks and enforces the current password expiration policy</para>
199<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
200</listitem>
201</varlistentry>
202
203<varlistentry id="faillog">
204<term><command>faillog</command></term>
205<listitem>
206<para>Is used to examine the log of login failures, to set a maximum number of
207failures before an account is blocked, or to reset the failure count</para>
208<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
209</listitem>
210</varlistentry>
211
212<varlistentry id="gpasswd">
213<term><command>gpasswd</command></term>
214<listitem>
215<para>Is used to add and delete members and administrators to groups</para>
216<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
217</listitem>
218</varlistentry>
219
220<varlistentry id="groupadd">
221<term><command>groupadd</command></term>
222<listitem>
223<para>Creates a group with the given name</para>
224<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
225</listitem>
226</varlistentry>
227
228<varlistentry id="groupdel">
229<term><command>groupdel</command></term>
230<listitem>
231<para>Deletes the group with the given name</para>
232<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
233</listitem>
234</varlistentry>
235
236<varlistentry id="groupmod">
237<term><command>groupmod</command></term>
238<listitem>
239<para>Is used to modify the given group's name or GID</para>
240<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
241</listitem>
242</varlistentry>
243
244<varlistentry id="groups">
245<term><command>groups</command></term>
246<listitem>
247<para>Reports the groups of which the given users are members</para>
248<indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</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="mkpasswd">
303<term><command>mkpasswd</command></term>
304<listitem>
305<para>Generates random passwords</para>
306<indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
307</listitem>
308</varlistentry>
309
310<varlistentry id="newgrp">
311<term><command>newgrp</command></term>
312<listitem>
313<para>Is used to change the current GID during a login session</para>
314<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
315</listitem>
316</varlistentry>
317
318<varlistentry id="newusers">
319<term><command>newusers</command></term>
320<listitem>
321<para>Is used to create or update an entire series of user accounts</para>
322<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
323</listitem>
324</varlistentry>
325
326<varlistentry id="passwd">
327<term><command>passwd</command></term>
328<listitem>
329<para>Is used to change the password for a user or group account</para>
330<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
331</listitem>
332</varlistentry>
333
334<varlistentry id="pwck">
335<term><command>pwck</command></term>
336<listitem>
337<para>Verifies the integrity of the password files
338<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename></para>
339<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
340</listitem>
341</varlistentry>
342
343<varlistentry id="pwconv">
344<term><command>pwconv</command></term>
345<listitem>
346<para>Creates or updates the shadow password file from the normal
347password file</para>
348<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
349</listitem>
350</varlistentry>
351
352<varlistentry id="pwunconv">
353<term><command>pwunconv</command></term>
354<listitem>
355<para>Updates <filename>/etc/passwd</filename>
356from <filename>/etc/shadow</filename> and then deletes the latter</para>
357<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
358</listitem>
359</varlistentry>
360
361<varlistentry id="sg">
362<term><command>sg</command></term>
363<listitem>
364<para>Executes a given command while the user's GID
365is set to that of the given group</para>
366<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
367</listitem>
368</varlistentry>
369
370<varlistentry id="su">
371<term><command>su</command></term>
372<listitem>
373<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
374<para>Runs a shell with substitute user and group IDs</para>
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.