source: chapter06/shadow.xml@ 15be431

Last change on this file since 15be431 was 15be431, checked in by Jim Gifford <jim@…>, 19 years ago

Fixed: shadow lastlog issue

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

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