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

Last change on this file since 7dda2f2 was cfaf68c, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Port configure command from trunk for module-init-tools.
Port the groups man page sed from trunk for shadow.

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