source: chapter06/shadow.xml@ 9278974d

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 9278974d was e6c8119, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Fixed generation of diff's man page, fixes #1800.
Thanks Randy McMurchy for the report and Ken Moffat for the fix.
Also, some slight wording adjustments on the Shadow page.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7627 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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