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

Last change on this file since 14af44b was 0c263d7, checked in by Joe Ciccone <jciccone@…>, 18 years ago

Added Shadow patch to fix useradd.

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