source: chapter06/shadow.xml@ 4b3ac50

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 12.2 12.2-rc1 6.0 6.1 6.1.1 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/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 4b3ac50 was 4b3ac50, checked in by Zack Winkles <winkie@…>, 20 years ago

Fix permissions of files that have been edited inline by sed

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