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">
8 <sect1 id="ch-system-shadow" role="wrap">
9 <?dbhtml filename="shadow.html"?>
11 <sect1info condition="script">
12 <productname>shadow</productname>
13 <productnumber>&shadow-version;</productnumber>
14 <address>&shadow-url;</address>
17 <title>Shadow-&shadow-version;</title>
19 <indexterm zone="ch-system-shadow">
20 <primary sortas="a-Shadow">Shadow</primary>
23 <sect2 role="package">
26 <para>The Shadow package contains programs for handling passwords in a secure
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
34 <seg>&shadow-ch6-sbu;</seg>
35 <seg>&shadow-ch6-du;</seg>
41 <sect2 role="installation">
42 <title>Installation of Shadow</title>
45 <para>If you would like to enforce the use of strong passwords, refer to
46 <ulink url="&blfs-book;postlfs/cracklib.html"/> for installing
47 CrackLib prior to building Shadow. Then add
48 <parameter>--with-libcrack</parameter> to the <command>configure</command>
52 <para>Disable the installation of the <command>groups</command> program
53 and its man pages, as Coreutils provides a better version. Also,
54 prevent the installation of manual pages that were already installed in
55 <xref linkend="ch-system-man-pages"/>:</para>
57 <screen><userinput remap="pre">sed -i 's/groups$(EXEEXT) //' src/Makefile.in
58 find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
59 find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
60 find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></screen>
62 <para id="shadow-login_defs">Instead of using the default
63 <emphasis>crypt</emphasis> method, use the more secure
64 <emphasis>SHA-512</emphasis> method of password encryption, which also
65 allows passwords longer than 8 characters. It is also necessary to change
66 the obsolete <filename class="directory">/var/spool/mail</filename> location
67 for user mailboxes that Shadow uses by default to the <filename
68 class="directory">/var/mail</filename> location used currently:</para>
70 <screen><userinput remap="pre">sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \
71 -e 's@/var/spool/mail@/var/mail@' etc/login.defs</userinput></screen>
74 <para>If you chose to build Shadow with Cracklib support, run the following:</para>
76 <screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs</userinput></screen>
79 <para>Make a minor change to make the first group number generated
80 by useradd 1000:</para>
82 <screen><userinput remap="pre">sed -i 's/1000/999/' etc/useradd</userinput></screen>
84 <para>Prepare Shadow for compilation:</para>
86 <screen><userinput remap="configure">./configure --sysconfdir=/etc --with-group-name-max-length=32</userinput></screen>
89 <title>The meaning of the configure option:</title>
92 <term><parameter>--with-group-name-max-length=32</parameter></term>
94 <para>The maximum user name is 32 characters. Make the maximum
95 group name the same.</para>
101 <para>Compile the package:</para>
103 <screen><userinput remap="make">make</userinput></screen>
105 <para>This package does not come with a test suite.</para>
107 <para>Install the package:</para>
109 <screen><userinput remap="install">make install</userinput></screen>
111 <para>Move a misplaced program to its proper location:</para>
113 <screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
116 <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
118 <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
119 rm -v /lib/libshadow.so
120 ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
124 <sect2 id="conf-shadow" role="configuration">
125 <title>Configuring Shadow</title>
127 <indexterm zone="conf-shadow">
128 <primary sortas="a-Shadow">Shadow</primary>
129 <secondary>configuring</secondary>
132 <para>This package contains utilities to add, modify, and delete users and
133 groups; set and change their passwords; and perform other administrative
134 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
135 means, see the <filename>doc/HOWTO</filename> file within the unpacked
136 source tree. If using Shadow support, keep in mind that programs which need
137 to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
138 must be Shadow-compliant. That is, they need to be able to work with
139 shadowed passwords.</para>
141 <para>To enable shadowed passwords, run the following command:</para>
143 <screen><userinput>pwconv</userinput></screen>
145 <para>To enable shadowed group passwords, run:</para>
147 <screen><userinput>grpconv</userinput></screen>
149 <para>Shadow's stock configuration for the <command>useradd</command>
150 utility has a few caveats that need some explanation. First, the default
151 action for the <command>useradd</command> utility is to create the user and
152 a group of the same name as the user. By default the user ID (UID) and
153 group ID (GID) numbers will begin with 1000. This means if you don't pass
154 parameters to <command>useradd</command>, each user will be a member of a
155 unique group on the system. If this behavior is undesirable, you'll need
156 to pass the <parameter>-g</parameter> parameter to
157 <command>useradd</command>. The default parameters are stored in the
158 <filename>/etc/default/useradd</filename> file. You may need to modify two
159 parameters in this file to suit your particular needs.</para>
162 <title><filename>/etc/default/useradd</filename> Parameter Explanations</title>
165 <term><parameter>GROUP=1000</parameter></term>
167 <para>This parameter sets the beginning of the group numbers used in
168 the /etc/group file. You can modify it to anything you desire. Note
169 that <command>useradd</command> will never reuse a UID or GID. If the
170 number identified in this parameter is used, it will use the next
171 available number after this. Note also that if you don't have a group
172 1000 on your system the first time you use <command>useradd</command>
173 without the <parameter>-g</parameter> parameter, you'll get a message
174 displayed on the terminal that says:
175 <computeroutput>useradd: unknown GID 1000</computeroutput>. You may
176 disregard this message and group number 1000 will be used.</para>
180 <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
182 <para>This parameter causes <command>useradd</command> to create a
183 mailbox file for the newly created user. <command>useradd</command>
184 will make the group ownership of this file to the
185 <systemitem class="groupname">mail</systemitem> group with 0660
186 permissions. If you would prefer that these mailbox files are not
187 created by <command>useradd</command>, issue the following
190 <screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
199 <sect2 role="configuration">
200 <title>Setting the root password</title>
202 <para>Choose a password for user <emphasis>root</emphasis> and set it
205 <screen role="nodump"><userinput>passwd root</userinput></screen>
209 <sect2 id="contents-shadow" role="content">
210 <title>Contents of Shadow</title>
213 <segtitle>Installed programs</segtitle>
214 <segtitle>Installed directory</segtitle>
217 <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
218 groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
219 lastlog, login, logoutd, newgidmap, newgrp, newuidmap, newusers,
220 nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su,
221 useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
222 <seg>/etc/default</seg>
227 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
228 <?dbfo list-presentation="list"?>
229 <?dbhtml list-presentation="table"?>
231 <varlistentry id="chage">
232 <term><command>chage</command></term>
234 <para>Used to change the maximum number of days between obligatory
235 password changes</para>
236 <indexterm zone="ch-system-shadow chage">
237 <primary sortas="b-chage">chage</primary>
242 <varlistentry id="chfn">
243 <term><command>chfn</command></term>
245 <para>Used to change a user's full name and other information</para>
246 <indexterm zone="ch-system-shadow chfn">
247 <primary sortas="b-chfn">chfn</primary>
252 <varlistentry id="chgpasswd">
253 <term><command>chgpasswd</command></term>
255 <para>Used to update group passwords in batch mode</para>
256 <indexterm zone="ch-system-shadow chgpasswd">
257 <primary sortas="b-chgpasswd">chgpasswd</primary>
262 <varlistentry id="chpasswd">
263 <term><command>chpasswd</command></term>
265 <para>Used to update user passwords in batch mode</para>
266 <indexterm zone="ch-system-shadow chpasswd">
267 <primary sortas="b-chpasswd">chpasswd</primary>
272 <varlistentry id="chsh">
273 <term><command>chsh</command></term>
275 <para>Used to change a user's default login shell</para>
276 <indexterm zone="ch-system-shadow chsh">
277 <primary sortas="b-chsh">chsh</primary>
282 <varlistentry id="expiry">
283 <term><command>expiry</command></term>
285 <para>Checks and enforces the current password expiration policy</para>
286 <indexterm zone="ch-system-shadow expiry">
287 <primary sortas="b-expiry">expiry</primary>
292 <varlistentry id="faillog">
293 <term><command>faillog</command></term>
295 <para>Is used to examine the log of login failures, to set a maximum
296 number of failures before an account is blocked, or to reset the
298 <indexterm zone="ch-system-shadow faillog">
299 <primary sortas="b-faillog">faillog</primary>
304 <varlistentry id="gpasswd">
305 <term><command>gpasswd</command></term>
307 <para>Is used to add and delete members and administrators to
309 <indexterm zone="ch-system-shadow gpasswd">
310 <primary sortas="b-gpasswd">gpasswd</primary>
315 <varlistentry id="groupadd">
316 <term><command>groupadd</command></term>
318 <para>Creates a group with the given name</para>
319 <indexterm zone="ch-system-shadow groupadd">
320 <primary sortas="b-groupadd">groupadd</primary>
325 <varlistentry id="groupdel">
326 <term><command>groupdel</command></term>
328 <para>Deletes the group with the given name</para>
329 <indexterm zone="ch-system-shadow groupdel">
330 <primary sortas="b-groupdel">groupdel</primary>
335 <varlistentry id="groupmems">
336 <term><command>groupmems</command></term>
338 <para>Allows a user to administer his/her own group membership list
339 without the requirement of super user privileges.</para>
340 <indexterm zone="ch-system-shadow groupmems">
341 <primary sortas="b-groupmems">groupmems</primary>
346 <varlistentry id="groupmod">
347 <term><command>groupmod</command></term>
349 <para>Is used to modify the given group's name or GID</para>
350 <indexterm zone="ch-system-shadow groupmod">
351 <primary sortas="b-groupmod">groupmod</primary>
356 <varlistentry id="grpck">
357 <term><command>grpck</command></term>
359 <para>Verifies the integrity of the group files
360 <filename>/etc/group</filename> and
361 <filename>/etc/gshadow</filename></para>
362 <indexterm zone="ch-system-shadow grpck">
363 <primary sortas="b-grpck">grpck</primary>
368 <varlistentry id="grpconv">
369 <term><command>grpconv</command></term>
371 <para>Creates or updates the shadow group file from the normal
373 <indexterm zone="ch-system-shadow grpconv">
374 <primary sortas="b-grpconv">grpconv</primary>
379 <varlistentry id="grpunconv">
380 <term><command>grpunconv</command></term>
382 <para>Updates <filename>/etc/group</filename> from
383 <filename>/etc/gshadow</filename> and then deletes the latter</para>
384 <indexterm zone="ch-system-shadow grpunconv">
385 <primary sortas="b-grpunconv">grpunconv</primary>
390 <varlistentry id="lastlog">
391 <term><command>lastlog</command></term>
393 <para>Reports the most recent login of all users or of a
395 <indexterm zone="ch-system-shadow lastlog">
396 <primary sortas="b-lastlog">lastlog</primary>
401 <varlistentry id="login">
402 <term><command>login</command></term>
404 <para>Is used by the system to let users sign on</para>
405 <indexterm zone="ch-system-shadow login">
406 <primary sortas="b-login">login</primary>
411 <varlistentry id="logoutd">
412 <term><command>logoutd</command></term>
414 <para>Is a daemon used to enforce restrictions on log-on time
416 <indexterm zone="ch-system-shadow logoutd">
417 <primary sortas="b-logoutd">logoutd</primary>
422 <varlistentry id="newgidmap">
423 <term><command>newgidmap</command></term>
425 <para>Is used to set the gid mapping of a user namespace</para>
426 <indexterm zone="ch-system-shadow newgidmap">
427 <primary sortas="b-newgidmap">newgidmap</primary>
432 <varlistentry id="newgrp">
433 <term><command>newgrp</command></term>
435 <para>Is used to change the current GID during a login session</para>
436 <indexterm zone="ch-system-shadow newgrp">
437 <primary sortas="b-newgrp">newgrp</primary>
442 <varlistentry id="newuidmap">
443 <term><command>newuidmap</command></term>
445 <para>Is used to set the uid mapping of a user namespace</para>
446 <indexterm zone="ch-system-shadow newuidmap">
447 <primary sortas="b-newuidmap">newuidmap</primary>
452 <varlistentry id="newusers">
453 <term><command>newusers</command></term>
455 <para>Is used to create or update an entire series of user
457 <indexterm zone="ch-system-shadow newusers">
458 <primary sortas="b-newusers">newusers</primary>
463 <varlistentry id="nologin">
464 <term><command>nologin</command></term>
466 <para>Displays a message that an account is not available; it is designed
467 to be used as the default shell for accounts that have been
469 <indexterm zone="ch-system-shadow nologin">
470 <primary sortas="b-nologin">nologin</primary>
475 <varlistentry id="passwd">
476 <term><command>passwd</command></term>
478 <para>Is used to change the password for a user or group account</para>
479 <indexterm zone="ch-system-shadow passwd">
480 <primary sortas="b-passwd">passwd</primary>
485 <varlistentry id="pwck">
486 <term><command>pwck</command></term>
488 <para>Verifies the integrity of the password files
489 <filename>/etc/passwd</filename> and
490 <filename>/etc/shadow</filename></para>
491 <indexterm zone="ch-system-shadow pwck">
492 <primary sortas="b-pwck">pwck</primary>
497 <varlistentry id="pwconv">
498 <term><command>pwconv</command></term>
500 <para>Creates or updates the shadow password file from the normal
502 <indexterm zone="ch-system-shadow pwconv">
503 <primary sortas="b-pwconv">pwconv</primary>
508 <varlistentry id="pwunconv">
509 <term><command>pwunconv</command></term>
511 <para>Updates <filename>/etc/passwd</filename> from
512 <filename>/etc/shadow</filename> and then deletes the latter</para>
513 <indexterm zone="ch-system-shadow pwunconv">
514 <primary sortas="b-pwunconv">pwunconv</primary>
519 <varlistentry id="sg">
520 <term><command>sg</command></term>
522 <para>Executes a given command while the user's GID
523 is set to that of the given group</para>
524 <indexterm zone="ch-system-shadow sg">
525 <primary sortas="b-sg">sg</primary>
530 <varlistentry id="su">
531 <term><command>su</command></term>
533 <para>Runs a shell with substitute user and group IDs</para>
534 <indexterm zone="ch-system-shadow su">
535 <primary sortas="b-su">su</primary>
540 <varlistentry id="useradd">
541 <term><command>useradd</command></term>
543 <para>Creates a new user with the given name, or updates the default
544 new-user information</para>
545 <indexterm zone="ch-system-shadow useradd">
546 <primary sortas="b-useradd">useradd</primary>
551 <varlistentry id="userdel">
552 <term><command>userdel</command></term>
554 <para>Deletes the given user account</para>
555 <indexterm zone="ch-system-shadow userdel">
556 <primary sortas="b-userdel">userdel</primary>
561 <varlistentry id="usermod">
562 <term><command>usermod</command></term>
564 <para>Is used to modify the given user's login name, User
565 Identification (UID), shell, initial group, home directory, etc.</para>
566 <indexterm zone="ch-system-shadow usermod">
567 <primary sortas="b-usermod">usermod</primary>
572 <varlistentry id="vigr">
573 <term><command>vigr</command></term>
575 <para>Edits the <filename>/etc/group</filename> or
576 <filename>/etc/gshadow</filename> files</para>
577 <indexterm zone="ch-system-shadow vigr">
578 <primary sortas="b-vigr">vigr</primary>
583 <varlistentry id="vipw">
584 <term><command>vipw</command></term>
586 <para>Edits the <filename>/etc/passwd</filename> or
587 <filename>/etc/shadow</filename> files</para>
588 <indexterm zone="ch-system-shadow vipw">
589 <primary sortas="b-vipw">vipw</primary>