source: chapter06/shadow.xml@ 50e693d

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 50e693d was e990c367, checked in by Matthew Burgess <matthew@…>, 18 years ago

Upgrade to Shadow 4.0.14

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

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