source: clfs-sysroot/BOOK/final-system/common/shadow.xml@ cc400ad

Last change on this file since cc400ad was b9b48cc, checked in by Joe Ciccone <jciccone@…>, 18 years ago

Changed shadow instructions for disabling installation of groups program man pages

  • Property mode set to 100644
File size: 19.7 KB
RevLine 
[02095ae]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-shadow" role="wrap">
9 <?dbhtml filename="shadow.html"?>
10
11 <title>Shadow-&shadow-version;</title>
12
13 <indexterm zone="ch-system-shadow">
14 <primary sortas="a-Shadow">Shadow</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Shadow package contains programs for handling passwords in a
21 secure way.</para>
22
23 </sect2>
24
25 <sect2 role="installation">
26 <title>Installation of Shadow</title>
27
28 <note os="a">
29 <para>If you would like to enforce the use of strong passwords,
30 refer to <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/>
31 for installing Cracklib prior to building Shadow. Then add
32 <parameter>--with-libcrack</parameter> to the <command>configure</command>
33 command below.</para>
34 </note>
35
[c8e9ef0]36 <para os="p1">The following patch fixes an issue in useradd, where it only
37 accepts group names, not group id numbers:</para>
[0c263d7]38
39<screen os="p2"><userinput>patch -Np1 -i ../&shadow-useradd_fix-patch;</userinput></screen>
40
[02095ae]41 <para os="b">Create a config.cache containing information about a test that
42 cannot be run when cross-compiling:</para>
43
44<screen os="c"><userinput>echo "ac_cv_func_setpgrp_void=yes" &gt; config.cache</userinput></screen>
45
46 <para os="d">Prepare Shadow for compilation:</para>
47
[cee2ca2]48<screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
49 --libdir=/lib --sysconfdir=/etc --enable-shared \
[02095ae]50 --without-libpam --without-audit --without-selinux \
[cee2ca2]51 --cache-file=config.cache</userinput></screen>
[02095ae]52
53<para os="f">The meaning of the configure options:</para>
54
55 <variablelist os="g">
[f191b12]56 <varlistentry>
57 <term><parameter>--sysconfdir=/etc</parameter></term>
58 <listitem><para>Tells Shadow to install its configuration files into
59 /etc, rather than /usr/etc.</para></listitem>
60 </varlistentry>
[02095ae]61 <varlistentry>
62 <term><parameter>--without-libpam</parameter></term>
63 <listitem><para>Support for Linux-PAM is enabled by default in Shadow,
[5590e0d]64 however PAM is not installed on a base CLFS system, so this switch
[02095ae]65 disables PAM support in Shadow. For instructions to install PAM and
66 link Shadow to it, you can look at
67 <ulink url="&blfs-root;view/svn/postlfs/shadow.html"/>.</para></listitem>
68 </varlistentry>
69 <varlistentry>
70 <term><parameter>--without-audit</parameter></term>
71 <listitem><para>Support for auditing is enabled by default, but a
[5590e0d]72 library that it needs is not installed in a base CLFS system. This
[02095ae]73 switch disables auditing support.</para></listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><parameter>--without-selinux</parameter></term>
77 <listitem><para>Support for selinux is enabled by default, but selinux
[5590e0d]78 is not built in a base CLFS system and configure will fail without this
[02095ae]79 switch.</para></listitem>
80 </varlistentry>
81 </variablelist>
82
83 <para os="h">Disable the installation of the <command>groups</command>
84 program and its man pages, as Coreutils provides a better version:</para>
85
[3349a3a]86<screen os="i"><userinput>cp src/Makefile{,.orig}
87sed 's/groups$(EXEEXT) //' src/Makefile.orig &gt; src/Makefile
88cp man/Makefile{,.orig}
[b9b48cc]89sed -e '/groups1.xml/d' \
90 -e 's/groups.1//' man/Makefile.orig &gt; man/Makefile</userinput></screen>
[02095ae]91
92 <para os="j">Compile the package:</para>
93
94<screen os="k"><userinput>make</userinput></screen>
95
96 <para os="l">Install the package:</para>
97
[586feb7]98<screen os="m"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
[02095ae]99
100 <para id="shadow-login_defs" os="r">Instead of using the default
101 <emphasis>crypt</emphasis> method, use the more secure
102 <emphasis>MD5</emphasis> method of password encryption, which also allows
103 passwords longer than 8 characters. It is also necessary to change the
104 obsolete <filename class="directory">/var/spool/mail</filename> location
105 for user mailboxes that Shadow uses by default to the <filename
[5590e0d]106 class="directory">/var/mail</filename> location used currently. Use the
107 following sed command to make these changes to the appropriate
108 configuration file:</para>
[02095ae]109
110 <indexterm zone="shadow-login_defs" os="s">
111 <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
112 </indexterm>
113
[586feb7]114<screen os="t"><userinput>cp ${CLFS}/etc/login.defs login.defs.orig
[82b662d]115sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
[02095ae]116 -e 's@/var/spool/mail@/var/mail@' \
[586feb7]117 login.defs.orig &gt; ${CLFS}/etc/login.defs</userinput></screen>
[02095ae]118
119 <note os="u">
120 <para>If you built Shadow with Cracklib support, execute
121 this <command>sed</command> to correct the path to the Cracklib
122 dictionary:</para>
123
[1a09536]124<screen role="nodump"><userinput>cp ${CLFS}/etc/login.defs login.defs.orig
[586feb7]125sed 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' login.defs.orig &gt; ${CLFS}/etc/login.defs</userinput></screen>
[02095ae]126 </note>
127
128 <para os="v">Move a misplaced program to its proper location:</para>
129
[586feb7]130<screen os="w"><userinput>mv -v ${CLFS}/usr/bin/passwd ${CLFS}/bin</userinput></screen>
[02095ae]131
132 <para os="x">Move Shadow's dynamic libraries to a more appropriate
133 location:</para>
134
[586feb7]135<screen os="y"><userinput>mv -v ${CLFS}/lib/libshadow.*a ${CLFS}/usr/lib
136rm -v ${CLFS}/lib/libshadow.so
137ln -svf ../../lib/libshadow.so.0 ${CLFS}/usr/lib/libshadow.so</userinput></screen>
[02095ae]138
139 </sect2>
140
141 <sect2 id="conf-shadow" role="configuration">
142 <title>Configuring Shadow</title>
143
144 <indexterm zone="conf-shadow">
145 <primary sortas="a-Shadow">Shadow</primary>
146 <secondary>configuring</secondary>
147 </indexterm>
148
149 <para>This package contains utilities to add, modify, and delete users and
150 groups; set and change their passwords; and perform other administrative
151 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
152 means, see the <filename>doc/HOWTO</filename> file within the unpacked source
153 tree. If using Shadow support, keep in mind that programs which need to
154 verify passwords (display managers, FTP programs, pop3 daemons, etc.) must
155 be Shadow-compliant. That is, they need to be able to work with shadowed
156 passwords.</para>
157
158 <para>To enable shadowed passwords, run the following command:</para>
159
[f5dc8de]160<screen role="nodump"><userinput>pwconv</userinput></screen>
[02095ae]161
162 <para>To enable shadowed group passwords, run:</para>
163
164<screen role="nodump"><userinput>grpconv</userinput></screen>
165
[5590e0d]166 <para>To view or change the default settings for new user accounts that
[32a0631]167 you create, you can edit <filename>/etc/default/useradd</filename>. See
[5590e0d]168 <command>man useradd</command> or
169 <ulink url="&blfs-root;view/svn/postlfs/skel.html"/> for more
170 information.</para>
171
[02095ae]172 </sect2>
173
174 <sect2 id="root-password" role="configuration">
175 <title>Setting the root password</title>
176
177 <para>Choose a password for user <systemitem
178 class="username">root</systemitem> and set it by running:</para>
179
180<screen role="nodump"><userinput>passwd root</userinput></screen>
181
182 </sect2>
183
184 <sect2 id="contents-shadow" role="content">
185 <title>Contents of Shadow</title>
186
187 <segmentedlist>
188 <segtitle>Installed programs</segtitle>
189 <segtitle>Installed libraries</segtitle>
190
191 <seglistitem>
[59fb197]192 <seg>chage, chfn, chpasswd, chgpasswd, chsh, expiry, faillog, gpasswd,
193 groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog,
[82b662d]194 login, logoutd, newgrp, newusers, nologin, passwd, pwck, pwconv,
195 pwunconv, sg (link to newgrp), useradd, userdel, usermod,
196 vigr (link to vipw), and vipw</seg>
[02095ae]197 <seg>libshadow.[a,so]</seg>
198 </seglistitem>
199 </segmentedlist>
200
201 <variablelist>
202 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
203 <?dbfo list-presentation="list"?>
204 <?dbhtml list-presentation="table"?>
205
206 <varlistentry id="chage">
207 <term><command>chage</command></term>
208 <listitem>
209 <para>Used to change the maximum number of days between obligatory
210 password changes</para>
211 <indexterm zone="ch-system-shadow chage">
212 <primary sortas="b-chage">chage</primary>
213 </indexterm>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry id="chfn">
218 <term><command>chfn</command></term>
219 <listitem>
220 <para>Used to change a user's full name and other information</para>
221 <indexterm zone="ch-system-shadow chfn">
222 <primary sortas="b-chfn">chfn</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
[59fb197]227 <varlistentry id="chgpasswd">
228 <term><command>chgpasswd</command></term>
229 <listitem>
230 <para>Used to update group passwords in batch mode</para>
231 <indexterm zone="ch-system-shadow chgpasswd">
232 <primary sortas="b-chgpasswd">chgpasswd</primary>
233 </indexterm>
234 </listitem>
235 </varlistentry>
236
[02095ae]237 <varlistentry id="chpasswd">
238 <term><command>chpasswd</command></term>
239 <listitem>
240 <para>Used to update the passwords of an entire series of user
241 accounts</para>
242 <indexterm zone="ch-system-shadow chpasswd">
243 <primary sortas="b-chpasswd">chpasswd</primary>
244 </indexterm>
245 </listitem>
246 </varlistentry>
247
248 <varlistentry id="chsh">
249 <term><command>chsh</command></term>
250 <listitem>
251 <para>Used to change a user's default login shell</para>
252 <indexterm zone="ch-system-shadow chsh">
253 <primary sortas="b-chsh">chsh</primary>
254 </indexterm>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry id="expiry">
259 <term><command>expiry</command></term>
260 <listitem>
261 <para>Checks and enforces the current password expiration policy</para>
262 <indexterm zone="ch-system-shadow expiry">
263 <primary sortas="b-expiry">expiry</primary>
264 </indexterm>
265 </listitem>
266 </varlistentry>
267
268 <varlistentry id="faillog">
269 <term><command>faillog</command></term>
270 <listitem>
271 <para>Is used to examine the log of login failures, to set a maximum
272 number of failures before an account is blocked, or to reset the
273 failure count</para>
274 <indexterm zone="ch-system-shadow faillog">
275 <primary sortas="b-faillog">faillog</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
280 <varlistentry id="gpasswd">
281 <term><command>gpasswd</command></term>
282 <listitem>
283 <para>Is used to add and delete members and administrators to
284 groups</para>
285 <indexterm zone="ch-system-shadow gpasswd">
286 <primary sortas="b-gpasswd">gpasswd</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="groupadd">
292 <term><command>groupadd</command></term>
293 <listitem>
294 <para>Creates a group with the given name</para>
295 <indexterm zone="ch-system-shadow groupadd">
296 <primary sortas="b-groupadd">groupadd</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="groupdel">
302 <term><command>groupdel</command></term>
303 <listitem>
304 <para>Deletes the group with the given name</para>
305 <indexterm zone="ch-system-shadow groupdel">
306 <primary sortas="b-groupdel">groupdel</primary>
307 </indexterm>
308 </listitem>
309 </varlistentry>
310
311 <varlistentry id="groupmod">
312 <term><command>groupmod</command></term>
313 <listitem>
314 <para>Is used to modify the given group's name or GID</para>
315 <indexterm zone="ch-system-shadow groupmod">
316 <primary sortas="b-groupmod">groupmod</primary>
317 </indexterm>
318 </listitem>
319 </varlistentry>
320
321 <varlistentry id="grpck">
322 <term><command>grpck</command></term>
323 <listitem>
324 <para>Verifies the integrity of the group files
325 <filename>/etc/group</filename> and
326 <filename>/etc/gshadow</filename></para>
327 <indexterm zone="ch-system-shadow grpck">
328 <primary sortas="b-grpck">grpck</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry id="grpconv">
334 <term><command>grpconv</command></term>
335 <listitem>
336 <para>Creates or updates the shadow group file from the normal
337 group file</para>
338 <indexterm zone="ch-system-shadow grpconv">
339 <primary sortas="b-grpconv">grpconv</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
343
344 <varlistentry id="grpunconv">
345 <term><command>grpunconv</command></term>
346 <listitem>
347 <para>Updates <filename>/etc/group</filename> from
348 <filename>/etc/gshadow</filename> and then deletes the latter</para>
349 <indexterm zone="ch-system-shadow grpunconv">
350 <primary sortas="b-grpunconv">grpunconv</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry id="lastlog">
356 <term><command>lastlog</command></term>
357 <listitem>
358 <para>Reports the most recent login of all users or of a
359 given user</para>
360 <indexterm zone="ch-system-shadow lastlog">
361 <primary sortas="b-lastlog">lastlog</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="login">
367 <term><command>login</command></term>
368 <listitem>
369 <para>Is used by the system to let users sign on</para>
370 <indexterm zone="ch-system-shadow login">
371 <primary sortas="b-login">login</primary>
372 </indexterm>
373 </listitem>
374 </varlistentry>
375
376 <varlistentry id="logoutd">
377 <term><command>logoutd</command></term>
378 <listitem>
379 <para>Is a daemon used to enforce restrictions on log-on time
380 and ports</para>
381 <indexterm zone="ch-system-shadow logoutd">
382 <primary sortas="b-logoutd">logoutd</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="newgrp">
388 <term><command>newgrp</command></term>
389 <listitem>
390 <para>Is used to change the current GID during a login session</para>
391 <indexterm zone="ch-system-shadow newgrp">
392 <primary sortas="b-newgrp">newgrp</primary>
393 </indexterm>
394 </listitem>
395 </varlistentry>
396
397 <varlistentry id="newusers">
398 <term><command>newusers</command></term>
399 <listitem>
400 <para>Is used to create or update an entire series of user
401 accounts</para>
402 <indexterm zone="ch-system-shadow newusers">
403 <primary sortas="b-newusers">newusers</primary>
404 </indexterm>
405 </listitem>
406 </varlistentry>
407
[82b662d]408 <varlistentry id="nologin">
409 <term><command>nologin</command></term>
410 <listitem>
411 <para>Displays a message that an account is not available. Designed
412 to be used as the default shell for accounts that have been
413 disabled</para>
414 <indexterm zone="ch-system-shadow nologin">
415 <primary sortas="b-nologin">nologin</primary>
416 </indexterm>
417 </listitem>
418 </varlistentry>
419
[02095ae]420 <varlistentry id="passwd">
421 <term><command>passwd</command></term>
422 <listitem>
423 <para>Is used to change the password for a user or group account</para>
424 <indexterm zone="ch-system-shadow passwd">
425 <primary sortas="b-passwd">passwd</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry id="pwck">
431 <term><command>pwck</command></term>
432 <listitem>
433 <para>Verifies the integrity of the password files
434 <filename>/etc/passwd</filename> and
435 <filename>/etc/shadow</filename></para>
436 <indexterm zone="ch-system-shadow pwck">
437 <primary sortas="b-pwck">pwck</primary>
438 </indexterm>
439 </listitem>
440 </varlistentry>
441
442 <varlistentry id="pwconv">
443 <term><command>pwconv</command></term>
444 <listitem>
445 <para>Creates or updates the shadow password file from the normal
446 password file</para>
447 <indexterm zone="ch-system-shadow pwconv">
448 <primary sortas="b-pwconv">pwconv</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="pwunconv">
454 <term><command>pwunconv</command></term>
455 <listitem>
456 <para>Updates <filename>/etc/passwd</filename> from
457 <filename>/etc/shadow</filename> and then deletes the latter</para>
458 <indexterm zone="ch-system-shadow pwunconv">
459 <primary sortas="b-pwunconv">pwunconv</primary>
460 </indexterm>
461 </listitem>
462 </varlistentry>
463
464 <varlistentry id="sg">
465 <term><command>sg</command></term>
466 <listitem>
467 <para>Executes a given command while the user's GID
468 is set to that of the given group</para>
469 <indexterm zone="ch-system-shadow sg">
470 <primary sortas="b-sg">sg</primary>
471 </indexterm>
472 </listitem>
473 </varlistentry>
474
475 <varlistentry id="su">
476 <term><command>su</command></term>
477 <listitem>
478 <para>Runs a shell with substitute user and group IDs</para>
479 <indexterm zone="ch-system-shadow su">
480 <primary sortas="b-su">su</primary>
481 </indexterm>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry id="useradd">
486 <term><command>useradd</command></term>
487 <listitem>
488 <para>Creates a new user with the given name, or updates the default
489 new-user information</para>
490 <indexterm zone="ch-system-shadow useradd">
491 <primary sortas="b-useradd">useradd</primary>
492 </indexterm>
493 </listitem>
494 </varlistentry>
495
496 <varlistentry id="userdel">
497 <term><command>userdel</command></term>
498 <listitem>
499 <para>Deletes the given user account</para>
500 <indexterm zone="ch-system-shadow userdel">
501 <primary sortas="b-userdel">userdel</primary>
502 </indexterm>
503 </listitem>
504 </varlistentry>
505
506 <varlistentry id="usermod">
507 <term><command>usermod</command></term>
508 <listitem>
509 <para>Is used to modify the given user's login name, User
510 Identification (UID), shell, initial group, home directory, etc.</para>
511 <indexterm zone="ch-system-shadow usermod">
512 <primary sortas="b-usermod">usermod</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="vigr">
518 <term><command>vigr</command></term>
519 <listitem>
520 <para>Edits the <filename>/etc/group</filename> or
521 <filename>/etc/gshadow</filename> files</para>
522 <indexterm zone="ch-system-shadow vigr">
523 <primary sortas="b-vigr">vigr</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="vipw">
529 <term><command>vipw</command></term>
530 <listitem>
531 <para>Edits the <filename>/etc/passwd</filename> or
532 <filename>/etc/shadow</filename> files</para>
533 <indexterm zone="ch-system-shadow vipw">
534 <primary sortas="b-vipw">vipw</primary>
535 </indexterm>
536 </listitem>
537 </varlistentry>
538
539 <varlistentry id="libshadow">
540 <term><filename class="libraryfile">libshadow</filename></term>
541 <listitem>
542 <para>Contains functions used by most programs in this package</para>
543 <indexterm zone="ch-system-shadow libshadow">
544 <primary sortas="c-libshadow">libshadow</primary>
545 </indexterm>
546 </listitem>
547 </varlistentry>
548
549 </variablelist>
550
551 </sect2>
552
553</sect1>
Note: See TracBrowser for help on using the repository browser.