source: chapter06/shadow.xml@ e110dfc

Last change on this file since e110dfc was 0a51467, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Ported form trink the appliccable changes in revisions r4896 to r4919.

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

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