source: chapter06/shadow.xml@ 5998892

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 5998892 was 5998892, checked in by Matthew Burgess <matthew@…>, 19 years ago

Add -v to commands that accept it

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@6913 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.3 SBU</seg><seg>15.9 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<note><para>If you would like to enforce the use of strong passwords, refer to
35<ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing Cracklib
36prior to building Shadow. Then add <parameter>--with-libcrack</parameter> to the
37<command>configure</command> command below.</para></note>
38
39<para>Prepare Shadow for compilation:</para>
40
41<screen><userinput>./configure --libdir=/lib --enable-shared</userinput></screen>
42
43<para>Disable the installation of the <command>groups</command> program and its man page, as Coreutils provides a better version:</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 configuration
58files:</para>
59
60<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/limits">/etc/limits</primary></indexterm>
61<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/login.access">/etc/login.access</primary></indexterm>
62
63<screen><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen>
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<note><para>If you built Shadow with Cracklib support, insert the following into
78the <command>sed</command> given below:</para>
79
80<screen><literal>-e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@'</literal></screen>
81</note>
82
83<screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
84 -e 's@/var/spool/mail@/var/mail@' \
85 etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
86
87<para>Move a misplaced program to its proper location:</para>
88
89<screen><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
90
91<para>Move Shadow's libraries to more appropriate locations:</para>
92
93<screen><userinput>mv -v /lib/libshadow.*a /usr/lib
94rm -v /lib/libshadow.so
95ln -sfv ../../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 -v /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</sect2>
147
148
149<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
150
151<segmentedlist>
152<segtitle>Installed programs</segtitle>
153<segtitle>Installed libraries</segtitle>
154<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
155groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login,
156logoutd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg (link to newgrp),
157su, useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
158<seg>libshadow.[a,so]</seg>
159</seglistitem>
160</segmentedlist>
161
162<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
163<?dbfo list-presentation="list"?>
164<?dbhtml list-presentation="table"?>
165
166<varlistentry id="chage">
167<term><command>chage</command></term>
168<listitem>
169<para>Used to change the maximum number of days between obligatory
170password changes</para>
171<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
172</listitem>
173</varlistentry>
174
175<varlistentry id="chfn">
176<term><command>chfn</command></term>
177<listitem>
178<para>Used to change a user's full name and other information</para>
179<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
180</listitem>
181</varlistentry>
182
183<varlistentry id="chpasswd">
184<term><command>chpasswd</command></term>
185<listitem>
186<para>Used to update the passwords of an entire series of user
187accounts</para>
188<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
189</listitem>
190</varlistentry>
191
192<varlistentry id="chsh">
193<term><command>chsh</command></term>
194<listitem>
195<para>Used to change a user's default login shell</para>
196<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
197</listitem>
198</varlistentry>
199
200<varlistentry id="expiry">
201<term><command>expiry</command></term>
202<listitem>
203<para>Checks and enforces the current password expiration policy</para>
204<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
205</listitem>
206</varlistentry>
207
208<varlistentry id="faillog">
209<term><command>faillog</command></term>
210<listitem>
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<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
214</listitem>
215</varlistentry>
216
217<varlistentry id="gpasswd">
218<term><command>gpasswd</command></term>
219<listitem>
220<para>Is used to add and delete members and administrators to groups</para>
221<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
222</listitem>
223</varlistentry>
224
225<varlistentry id="groupadd">
226<term><command>groupadd</command></term>
227<listitem>
228<para>Creates a group with the given name</para>
229<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
230</listitem>
231</varlistentry>
232
233<varlistentry id="groupdel">
234<term><command>groupdel</command></term>
235<listitem>
236<para>Deletes the group with the given name</para>
237<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
238</listitem>
239</varlistentry>
240
241<varlistentry id="groupmod">
242<term><command>groupmod</command></term>
243<listitem>
244<para>Is used to modify the given group's name or GID</para>
245<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
246</listitem>
247</varlistentry>
248
249<varlistentry id="grpck">
250<term><command>grpck</command></term>
251<listitem>
252<para>Verifies the integrity of the group files <filename>/etc/group</filename>
253and <filename>/etc/gshadow</filename></para>
254<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
255</listitem>
256</varlistentry>
257
258<varlistentry id="grpconv">
259<term><command>grpconv</command></term>
260<listitem>
261<para>Creates or updates the shadow group file from the normal group file</para>
262<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
263</listitem>
264</varlistentry>
265
266<varlistentry id="grpunconv">
267<term><command>grpunconv</command></term>
268<listitem>
269<para>Updates <filename>/etc/group</filename>
270from <filename>/etc/gshadow</filename> and then deletes the latter</para>
271<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
272</listitem>
273</varlistentry>
274
275<varlistentry id="lastlog">
276<term><command>lastlog</command></term>
277<listitem>
278<para>Reports the most recent login of all users or of a given user</para>
279<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
280</listitem>
281</varlistentry>
282
283<varlistentry id="login">
284<term><command>login</command></term>
285<listitem>
286<para>Is used by the system to let users sign on</para>
287<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
288</listitem>
289</varlistentry>
290
291<varlistentry id="logoutd">
292<term><command>logoutd</command></term>
293<listitem>
294<para>Is a daemon used to enforce restrictions on log-on time and ports</para>
295<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
296</listitem>
297</varlistentry>
298
299<varlistentry id="newgrp">
300<term><command>newgrp</command></term>
301<listitem>
302<para>Is used to change the current GID during a login session</para>
303<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
304</listitem>
305</varlistentry>
306
307<varlistentry id="newusers">
308<term><command>newusers</command></term>
309<listitem>
310<para>Is used to create or update an entire series of user accounts</para>
311<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
312</listitem>
313</varlistentry>
314
315<varlistentry id="passwd">
316<term><command>passwd</command></term>
317<listitem>
318<para>Is used to change the password for a user or group account</para>
319<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
320</listitem>
321</varlistentry>
322
323<varlistentry id="pwck">
324<term><command>pwck</command></term>
325<listitem>
326<para>Verifies the integrity of the password files
327<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename></para>
328<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
329</listitem>
330</varlistentry>
331
332<varlistentry id="pwconv">
333<term><command>pwconv</command></term>
334<listitem>
335<para>Creates or updates the shadow password file from the normal
336password file</para>
337<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
338</listitem>
339</varlistentry>
340
341<varlistentry id="pwunconv">
342<term><command>pwunconv</command></term>
343<listitem>
344<para>Updates <filename>/etc/passwd</filename>
345from <filename>/etc/shadow</filename> and then deletes the latter</para>
346<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
347</listitem>
348</varlistentry>
349
350<varlistentry id="sg">
351<term><command>sg</command></term>
352<listitem>
353<para>Executes a given command while the user's GID
354is set to that of the given group</para>
355<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
356</listitem>
357</varlistentry>
358
359<varlistentry id="su">
360<term><command>su</command></term>
361<listitem>
362<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
363<para>Runs a shell with substitute user and group IDs</para>
364</listitem>
365</varlistentry>
366
367<varlistentry id="useradd">
368<term><command>useradd</command></term>
369<listitem>
370<para>Creates a new user with the given name, or updates the default
371new-user information</para>
372<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
373</listitem>
374</varlistentry>
375
376<varlistentry id="userdel">
377<term><command>userdel</command></term>
378<listitem>
379<para>Deletes the given user account</para>
380<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
381</listitem>
382</varlistentry>
383
384<varlistentry id="usermod">
385<term><command>usermod</command></term>
386<listitem>
387<para>Is used to modify the given user's login name, User
388Identification (UID),
389shell, initial group, home directory, etc.</para>
390<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
391</listitem>
392</varlistentry>
393
394<varlistentry id="vigr">
395<term><command>vigr</command></term>
396<listitem>
397<para>Edits the <filename>/etc/group</filename> or
398<filename>/etc/gshadow</filename> files</para>
399<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
400</listitem>
401</varlistentry>
402
403<varlistentry id="vipw">
404<term><command>vipw</command></term>
405<listitem>
406<para>Edits the <filename>/etc/passwd</filename> or
407<filename>/etc/shadow</filename> files</para>
408<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
409</listitem>
410</varlistentry>
411
412<varlistentry id="libshadow">
413<term><filename class="libraryfile">libshadow</filename></term>
414<listitem>
415<para>Contains functions used by most programs in this package</para>
416<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
417</listitem>
418</varlistentry>
419</variablelist>
420
421</sect2>
422
423</sect1>
424
Note: See TracBrowser for help on using the repository browser.