source: BOOK/final-system/common/shadow.xml@ 6ef644e

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 6ef644e was aa18ac0, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Updated trunk book sources to use DocBook-XML DTD 4.5.

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