source: chapter06/shadow.xml@ 3990e9a

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 3990e9a was 3990e9a, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Missplaced period. Bug 1552.

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