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

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b9290f5 was 4f26def, checked in by Jim Gifford <clfs@…>, 18 years ago

r5464@server: jim | 2006-08-31 11:43:23 -0700
Added Shadow patch to fix useradd.

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