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

Last change on this file since 42910b8 was 12e6567, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Added a sysroot wrapper.
Updated the build variables section of the book, each package uses its own.

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