source: chapter06/shadow.xml@ 78dbbaa1

Last change on this file since 78dbbaa1 was 7b0c375c, checked in by Jeremy Utley <jeremy@…>, 20 years ago

Removed 2 unneccessary commands from shadow, per David Jensen's post on LFS-Dev

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

  • Property mode set to 100644
File size: 14.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-shadow" xreflabel="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>Shadow installation depends on</segtitle>
24<seglistitem><seg>Bash, Binutils, Bison, Coreutils,
25Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed</seg></seglistitem>
26</segmentedlist>
27</sect2>
28
29<sect2 role="installation">
30<title>Installation of Shadow</title>
31
32<para>Prepare Shadow for compilation:</para>
33
34<screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
35
36<para>Compile the package:</para>
37
38<screen><userinput>make</userinput></screen>
39
40<para>Then install it:</para>
41
42<screen><userinput>make install</userinput></screen>
43
44<para>Shadow uses two files to configure authentication settings for the
45system. Install these two config files:</para>
46
47<screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
48
49<para>Instead of using the default <emphasis>crypt</emphasis> method, we want
50to use the more secure <emphasis>MD5</emphasis> method of password encryption,
51which also allows passwords longer than 8 characters. We also need to
52change the obsolete <filename class="directory">/var/spool/mail</filename>
53location for user mailboxes that Shadow uses by default to the <filename
54class="directory">/var/mail</filename> location used currently. We accomplish
55both these things by changing the relevant configuration file while copying it
56to its destination (it's probably better to cut-and-paste this rather than try
57and type it all in):</para>
58
59<screen><userinput>cp etc/login.defs.linux /etc/login.defs
60sed -i -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
61 -e 's@/var/spool/mail@/var/mail@' /etc/login.defs</userinput></screen>
62
63<para>Move some misplaced symlinks/programs to their proper locations:</para>
64
65<screen><userinput>mv /usr/bin/passwd /bin</userinput></screen>
66
67<para>And move Shadow's dynamic libraries to a more appropriate location:</para>
68
69<screen><userinput>mv /usr/lib/libshadow.so.0* /lib</userinput></screen>
70
71<para>As some packages expect to find the just-moved libraries in
72<filename class="directory">/usr/lib</filename>, create the following symlinks:</para>
73
74<screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
75
76<para>The <parameter>-D</parameter> option of the <command>useradd</command> program requires this
77directory for it to work properly:</para>
78
79<screen><userinput>mkdir /etc/default</userinput></screen>
80
81<para>Coreutils has already installed a better <command>groups</command>
82program in <filename class="directory">/usr/bin</filename>. Remove the one
83installed by Shadow:</para>
84
85<screen><userinput>rm /bin/groups</userinput></screen>
86
87</sect2>
88
89
90<sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
91<indexterm zone="conf-shadow">
92<primary sortas="a-Shadow">Shadow</primary>
93<secondary>configuring</secondary></indexterm>
94
95<para>This package contains utilities to add, modify and delete users and
96groups, set and change their passwords, and other such administrative tasks.
97For a full explanation of what <emphasis>password shadowing</emphasis> means,
98see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
99There's one thing to keep in mind if you decide to use Shadow support: programs
100that need to verify passwords (display managers, ftp programs, pop3 daemons,
101and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
102need to be able to work with shadowed passwords.</para>
103
104<para>To enable shadowed passwords, run the following command:</para>
105
106<screen><userinput>pwconv</userinput></screen>
107
108<para>To enable shadowed group passwords, run:</para>
109
110<screen><userinput>grpconv</userinput></screen>
111
112<para>Under normal circumstances, you won't have created any passwords yet.
113However, if returning to this section later to enable shadowing, you should
114reset any current user passwords with the <command>passwd</command> command or
115any group passwords with the <command>gpasswd</command> command.</para>
116
117</sect2>
118
119
120<sect2 role="configuration">
121<title>Setting the root password</title>
122
123<para>Choose a password for user root and set it via:</para>
124
125<screen><userinput>passwd root</userinput></screen>
126
127</sect2>
128
129
130<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
131
132<segmentedlist>
133<segtitle>Installed programs</segtitle>
134<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
135groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login,
136logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg
137(link to newgrp), useradd, userdel, usermod, vigr (link to vipw) and vipw</seg>
138</seglistitem>
139</segmentedlist>
140
141<variablelist><title>Short descriptions</title>
142
143<varlistentry id="chage">
144<term><command>chage</command></term>
145<listitem>
146<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
147<para>is used to change the maximum number of
148days between obligatory password changes.</para>
149</listitem>
150</varlistentry>
151
152<varlistentry id="chfn">
153<term><command>chfn</command></term>
154<listitem>
155<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
156<para>is used to change a user's full name and some other info.</para>
157</listitem>
158</varlistentry>
159
160<varlistentry id="chpasswd">
161<term><command>chpasswd</command></term>
162<listitem>
163<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
164<para>is used to update the passwords of a
165whole series of user accounts in one go.</para>
166</listitem>
167</varlistentry>
168
169<varlistentry id="chsh">
170<term><command>chsh</command></term>
171<listitem>
172<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
173<para>is used to change a user's default login shell.</para>
174</listitem>
175</varlistentry>
176
177<varlistentry id="expiry">
178<term><command>expiry</command></term>
179<listitem>
180<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
181<para>checks and enforces the current password expiration policy.</para>
182</listitem>
183</varlistentry>
184
185<varlistentry id="faillog">
186<term><command>faillog</command></term>
187<listitem>
188<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
189<para>is used to examine the log of login failures, to set a maximum number of
190failures before an account is blocked, or to reset the failure count.</para>
191</listitem>
192</varlistentry>
193
194<varlistentry id="gpasswd">
195<term><command>gpasswd</command></term>
196<listitem>
197<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
198<para>is used to add and delete members and administrators to groups.</para>
199</listitem>
200</varlistentry>
201
202<varlistentry id="groupadd">
203<term><command>groupadd</command></term>
204<listitem>
205<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
206<para>creates a group with the given name.</para>
207</listitem>
208</varlistentry>
209
210<varlistentry id="groupdel">
211<term><command>groupdel</command></term>
212<listitem>
213<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
214<para>deletes the group with the given name.</para>
215</listitem>
216</varlistentry>
217
218<varlistentry id="groupmod">
219<term><command>groupmod</command></term>
220<listitem>
221<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
222<para>is used to modify the given group's name or GID.</para>
223</listitem>
224</varlistentry>
225
226<varlistentry id="groups">
227<term><command>groups</command></term>
228<listitem>
229<indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
230<para>reports the groups of which the given users are members.</para>
231</listitem>
232</varlistentry>
233
234<varlistentry id="grpck">
235<term><command>grpck</command></term>
236<listitem>
237<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
238<para>verifies the integrity of the group files, <filename>/etc/group</filename>
239and <filename>/etc/gshadow</filename>.</para>
240</listitem>
241</varlistentry>
242
243<varlistentry id="grpconv">
244<term><command>grpconv</command></term>
245<listitem>
246<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
247<para>creates or updates the shadow group file from the normal group file.</para>
248</listitem>
249</varlistentry>
250
251<varlistentry id="grpunconv">
252<term><command>grpunconv</command></term>
253<listitem>
254<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
255<para>updates <filename>/etc/group</filename>
256from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
257</listitem>
258</varlistentry>
259
260<varlistentry id="lastlog">
261<term><command>lastlog</command></term>
262<listitem>
263<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
264<para>reports the most recent login of all users, or of a given user.</para>
265</listitem>
266</varlistentry>
267
268<varlistentry id="login">
269<term><command>login</command></term>
270<listitem>
271<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
272<para>is used by the system to let users sign on.</para>
273</listitem>
274</varlistentry>
275
276<varlistentry id="logoutd">
277<term><command>logoutd</command></term>
278<listitem>
279<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
280<para>is a daemon used to enforce restrictions on log-on time and ports.</para>
281</listitem>
282</varlistentry>
283
284<varlistentry id="mkpasswd">
285<term><command>mkpasswd</command></term>
286<listitem>
287<indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
288<para>encrypts the given password using the also given perturbation.</para>
289</listitem>
290</varlistentry>
291
292<varlistentry id="newgrp">
293<term><command>newgrp</command></term>
294<listitem>
295<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
296<para>is used to change the current GID during a login session.</para>
297</listitem>
298</varlistentry>
299
300<varlistentry id="newusers">
301<term><command>newusers</command></term>
302<listitem>
303<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
304<para>is used to create or update a whole series of user accounts in one go.</para>
305</listitem>
306</varlistentry>
307
308<varlistentry id="passwd">
309<term><command>passwd</command></term>
310<listitem>
311<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
312<para>is used to change the password for a user or group account.</para>
313</listitem>
314</varlistentry>
315
316<varlistentry id="pwck">
317<term><command>pwck</command></term>
318<listitem>
319<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
320<para>verifies the integrity of the password files,
321<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
322</listitem>
323</varlistentry>
324
325<varlistentry id="pwconv">
326<term><command>pwconv</command></term>
327<listitem>
328<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
329<para>creates or updates the shadow password file
330from the normal password file.</para>
331</listitem>
332</varlistentry>
333
334<varlistentry id="pwunconv">
335<term><command>pwunconv</command></term>
336<listitem>
337<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
338<para>updates <filename>/etc/passwd</filename>
339from <filename>/etc/shadow</filename> and then deletes the latter.</para>
340</listitem>
341</varlistentry>
342
343<varlistentry id="sg">
344<term><command>sg</command></term>
345<listitem>
346<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
347<para>executes a given command while the user's GID
348is set to that of the given group.</para>
349</listitem>
350</varlistentry>
351
352<varlistentry id="su">
353<term><command>su</command></term>
354<listitem>
355<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
356<para>runs a shell with substitute user and group IDs.</para>
357</listitem>
358</varlistentry>
359
360<varlistentry id="useradd">
361<term><command>useradd</command></term>
362<listitem>
363<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
364<para>creates a new user with the given name,
365or updates the default new-user information.</para>
366</listitem>
367</varlistentry>
368
369<varlistentry id="userdel">
370<term><command>userdel</command></term>
371<listitem>
372<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
373<para>deletes the given user account.</para>
374</listitem>
375</varlistentry>
376
377<varlistentry id="usermod">
378<term><command>usermod</command></term>
379<listitem>
380<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
381<para>is used to modify the given user's login name, UID (User Identification),
382shell, initial group, home directory, and the like.</para>
383</listitem>
384</varlistentry>
385
386<varlistentry id="vigr">
387<term><command>vigr</command></term>
388<listitem>
389<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
390<para>can be used to edit the <filename>/etc/group</filename> or
391<filename>/etc/gshadow</filename> files.</para>
392</listitem>
393</varlistentry>
394
395<varlistentry id="vipw">
396<term><command>vipw</command></term>
397<listitem>
398<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
399<para>can be used to edit the <filename>/etc/passwd</filename> or
400<filename>/etc/shadow</filename> files.</para>
401</listitem>
402</varlistentry>
403
404<varlistentry id="libmisc">
405<term><filename class="libraryfile">libmisc</filename></term>
406<listitem>
407<indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
408<para>...</para>
409</listitem>
410</varlistentry>
411
412<varlistentry id="libshadow">
413<term><filename class="libraryfile">libshadow</filename></term>
414<listitem>
415<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
416<para>contains functions used by most programs in this package.</para>
417</listitem>
418</varlistentry>
419</variablelist>
420
421</sect2>
422
423</sect1>
Note: See TracBrowser for help on using the repository browser.