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 by the
55 <xref linkend="man-pages"/> package:</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="configure">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 default useradd consistent with the LFS
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>
115 <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
117 <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
118 rm -v /lib/libshadow.so
119 ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
123 <sect2 id="conf-shadow" role="configuration">
124 <title>Configuring Shadow</title>
126 <indexterm zone="conf-shadow">
127 <primary sortas="a-Shadow">Shadow</primary>
128 <secondary>configuring</secondary>
131 <para>This package contains utilities to add, modify, and delete users and
132 groups; set and change their passwords; and perform other administrative
133 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
134 means, see the <filename>doc/HOWTO</filename> file within the unpacked
135 source tree. If using Shadow support, keep in mind that programs which need
136 to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
137 must be Shadow-compliant. That is, they need to be able to work with
138 shadowed passwords.</para>
140 <para>To enable shadowed passwords, run the following command:</para>
142 <screen><userinput>pwconv</userinput></screen>
144 <para>To enable shadowed group passwords, run:</para>
146 <screen><userinput>grpconv</userinput></screen>
148 <para>Shadow's stock configuration for the <command>useradd</command>
149 utility has a few caveats that need some explanation. First, the default
150 action for the <command>useradd</command> utility is to create the user and
151 a group of the same name as the user. By default the user ID (UID) and
152 group ID (GID) numbers will begin with 1000. This means if you don't pass
153 parameters to <command>useradd</command>, each user will be a member of a
154 unique group on the system. If this behavior is undesirable, you'll need
155 to pass the <parameter>-g</parameter> parameter to
156 <command>useradd</command>. The default parameters are stored in the
157 <filename>/etc/default/useradd</filename> file. You may need to modify two
158 parameters in this file to suit your particular needs.</para>
161 <title><filename>/etc/default/useradd</filename> Parameter Explanations</title>
164 <term><parameter>GROUP=1000</parameter></term>
166 <para>This parameter sets the beginning of the group numbers used in
167 the /etc/group file. You can modify it to anything you desire. Note
168 that <command>useradd</command> will never reuse a UID or GID. If the
169 number identified in this parameter is used, it will use the next
170 available number after this. Note also that if you don't have a group
171 1000 on your system the first time you use <command>useradd</command>
172 without the <parameter>-g</parameter> parameter, you'll get a message
173 displayed on the terminal that says:
174 <computeroutput>useradd: unknown GID 1000</computeroutput>. You may
175 disregard this message and group number 1000 will be used.</para>
179 <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
181 <para>This parameter causes <command>useradd</command> to create a
182 mailbox file for the newly created user. <command>useradd</command>
183 will make the group ownership of this file to the
184 <systemitem class="groupname">mail</systemitem> group with 0660
185 permissions. If you would prefer that these mailbox files are not
186 created by <command>useradd</command>, issue the following
189 <screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
198 <sect2 role="configuration">
199 <title>Setting the root password</title>
201 <para>Choose a password for user <emphasis>root</emphasis> and set it
204 <screen role="nodump"><userinput>passwd root</userinput></screen>
208 <sect2 id="contents-shadow" role="content">
209 <title>Contents of Shadow</title>
212 <segtitle>Installed programs</segtitle>
213 <segtitle>Installed directory</segtitle>
216 <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
217 groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
218 lastlog, login, logoutd, newgidmap, newgrp, newuidmap, newusers,
219 nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su,
220 useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
221 <seg>/etc/default</seg>
226 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
227 <?dbfo list-presentation="list"?>
228 <?dbhtml list-presentation="table"?>
230 <varlistentry id="chage">
231 <term><command>chage</command></term>
233 <para>Used to change the maximum number of days between obligatory
234 password changes</para>
235 <indexterm zone="ch-system-shadow chage">
236 <primary sortas="b-chage">chage</primary>
241 <varlistentry id="chfn">
242 <term><command>chfn</command></term>
244 <para>Used to change a user's full name and other information</para>
245 <indexterm zone="ch-system-shadow chfn">
246 <primary sortas="b-chfn">chfn</primary>
251 <varlistentry id="chgpasswd">
252 <term><command>chgpasswd</command></term>
254 <para>Used to update group passwords in batch mode</para>
255 <indexterm zone="ch-system-shadow chgpasswd">
256 <primary sortas="b-chgpasswd">chgpasswd</primary>
261 <varlistentry id="chpasswd">
262 <term><command>chpasswd</command></term>
264 <para>Used to update user passwords in batch mode</para>
265 <indexterm zone="ch-system-shadow chpasswd">
266 <primary sortas="b-chpasswd">chpasswd</primary>
271 <varlistentry id="chsh">
272 <term><command>chsh</command></term>
274 <para>Used to change a user's default login shell</para>
275 <indexterm zone="ch-system-shadow chsh">
276 <primary sortas="b-chsh">chsh</primary>
281 <varlistentry id="expiry">
282 <term><command>expiry</command></term>
284 <para>Checks and enforces the current password expiration policy</para>
285 <indexterm zone="ch-system-shadow expiry">
286 <primary sortas="b-expiry">expiry</primary>
291 <varlistentry id="faillog">
292 <term><command>faillog</command></term>
294 <para>Is used to examine the log of login failures, to set a maximum
295 number of failures before an account is blocked, or to reset the
297 <indexterm zone="ch-system-shadow faillog">
298 <primary sortas="b-faillog">faillog</primary>
303 <varlistentry id="gpasswd">
304 <term><command>gpasswd</command></term>
306 <para>Is used to add and delete members and administrators to
308 <indexterm zone="ch-system-shadow gpasswd">
309 <primary sortas="b-gpasswd">gpasswd</primary>
314 <varlistentry id="groupadd">
315 <term><command>groupadd</command></term>
317 <para>Creates a group with the given name</para>
318 <indexterm zone="ch-system-shadow groupadd">
319 <primary sortas="b-groupadd">groupadd</primary>
324 <varlistentry id="groupdel">
325 <term><command>groupdel</command></term>
327 <para>Deletes the group with the given name</para>
328 <indexterm zone="ch-system-shadow groupdel">
329 <primary sortas="b-groupdel">groupdel</primary>
334 <varlistentry id="groupmems">
335 <term><command>groupmems</command></term>
337 <para>Allows a user to administer his/her own group membership list
338 without the requirement of super user privileges.</para>
339 <indexterm zone="ch-system-shadow groupmems">
340 <primary sortas="b-groupmems">groupmems</primary>
345 <varlistentry id="groupmod">
346 <term><command>groupmod</command></term>
348 <para>Is used to modify the given group's name or GID</para>
349 <indexterm zone="ch-system-shadow groupmod">
350 <primary sortas="b-groupmod">groupmod</primary>
355 <varlistentry id="grpck">
356 <term><command>grpck</command></term>
358 <para>Verifies the integrity of the group files
359 <filename>/etc/group</filename> and
360 <filename>/etc/gshadow</filename></para>
361 <indexterm zone="ch-system-shadow grpck">
362 <primary sortas="b-grpck">grpck</primary>
367 <varlistentry id="grpconv">
368 <term><command>grpconv</command></term>
370 <para>Creates or updates the shadow group file from the normal
372 <indexterm zone="ch-system-shadow grpconv">
373 <primary sortas="b-grpconv">grpconv</primary>
378 <varlistentry id="grpunconv">
379 <term><command>grpunconv</command></term>
381 <para>Updates <filename>/etc/group</filename> from
382 <filename>/etc/gshadow</filename> and then deletes the latter</para>
383 <indexterm zone="ch-system-shadow grpunconv">
384 <primary sortas="b-grpunconv">grpunconv</primary>
389 <varlistentry id="lastlog">
390 <term><command>lastlog</command></term>
392 <para>Reports the most recent login of all users or of a
394 <indexterm zone="ch-system-shadow lastlog">
395 <primary sortas="b-lastlog">lastlog</primary>
400 <varlistentry id="login">
401 <term><command>login</command></term>
403 <para>Is used by the system to let users sign on</para>
404 <indexterm zone="ch-system-shadow login">
405 <primary sortas="b-login">login</primary>
410 <varlistentry id="logoutd">
411 <term><command>logoutd</command></term>
413 <para>Is a daemon used to enforce restrictions on log-on time
415 <indexterm zone="ch-system-shadow logoutd">
416 <primary sortas="b-logoutd">logoutd</primary>
421 <varlistentry id="newgidmap">
422 <term><command>newgidmap</command></term>
424 <para>Is used to set the gid mapping of a user namespace</para>
425 <indexterm zone="ch-system-shadow newgidmap">
426 <primary sortas="b-newgidmap">newgidmap</primary>
431 <varlistentry id="newgrp">
432 <term><command>newgrp</command></term>
434 <para>Is used to change the current GID during a login session</para>
435 <indexterm zone="ch-system-shadow newgrp">
436 <primary sortas="b-newgrp">newgrp</primary>
441 <varlistentry id="newuidmap">
442 <term><command>newuidmap</command></term>
444 <para>Is used to set the uid mapping of a user namespace</para>
445 <indexterm zone="ch-system-shadow newuidmap">
446 <primary sortas="b-newuidmap">newuidmap</primary>
451 <varlistentry id="newusers">
452 <term><command>newusers</command></term>
454 <para>Is used to create or update an entire series of user
456 <indexterm zone="ch-system-shadow newusers">
457 <primary sortas="b-newusers">newusers</primary>
462 <varlistentry id="nologin">
463 <term><command>nologin</command></term>
465 <para>Displays a message that an account is not available; it is designed
466 to be used as the default shell for accounts that have been
468 <indexterm zone="ch-system-shadow nologin">
469 <primary sortas="b-nologin">nologin</primary>
474 <varlistentry id="passwd">
475 <term><command>passwd</command></term>
477 <para>Is used to change the password for a user or group account</para>
478 <indexterm zone="ch-system-shadow passwd">
479 <primary sortas="b-passwd">passwd</primary>
484 <varlistentry id="pwck">
485 <term><command>pwck</command></term>
487 <para>Verifies the integrity of the password files
488 <filename>/etc/passwd</filename> and
489 <filename>/etc/shadow</filename></para>
490 <indexterm zone="ch-system-shadow pwck">
491 <primary sortas="b-pwck">pwck</primary>
496 <varlistentry id="pwconv">
497 <term><command>pwconv</command></term>
499 <para>Creates or updates the shadow password file from the normal
501 <indexterm zone="ch-system-shadow pwconv">
502 <primary sortas="b-pwconv">pwconv</primary>
507 <varlistentry id="pwunconv">
508 <term><command>pwunconv</command></term>
510 <para>Updates <filename>/etc/passwd</filename> from
511 <filename>/etc/shadow</filename> and then deletes the latter</para>
512 <indexterm zone="ch-system-shadow pwunconv">
513 <primary sortas="b-pwunconv">pwunconv</primary>
518 <varlistentry id="sg">
519 <term><command>sg</command></term>
521 <para>Executes a given command while the user's GID
522 is set to that of the given group</para>
523 <indexterm zone="ch-system-shadow sg">
524 <primary sortas="b-sg">sg</primary>
529 <varlistentry id="su">
530 <term><command>su</command></term>
532 <para>Runs a shell with substitute user and group IDs</para>
533 <indexterm zone="ch-system-shadow su">
534 <primary sortas="b-su">su</primary>
539 <varlistentry id="useradd">
540 <term><command>useradd</command></term>
542 <para>Creates a new user with the given name, or updates the default
543 new-user information</para>
544 <indexterm zone="ch-system-shadow useradd">
545 <primary sortas="b-useradd">useradd</primary>
550 <varlistentry id="userdel">
551 <term><command>userdel</command></term>
553 <para>Deletes the given user account</para>
554 <indexterm zone="ch-system-shadow userdel">
555 <primary sortas="b-userdel">userdel</primary>
560 <varlistentry id="usermod">
561 <term><command>usermod</command></term>
563 <para>Is used to modify the given user's login name, User
564 Identification (UID), shell, initial group, home directory, etc.</para>
565 <indexterm zone="ch-system-shadow usermod">
566 <primary sortas="b-usermod">usermod</primary>
571 <varlistentry id="vigr">
572 <term><command>vigr</command></term>
574 <para>Edits the <filename>/etc/group</filename> or
575 <filename>/etc/gshadow</filename> files</para>
576 <indexterm zone="ch-system-shadow vigr">
577 <primary sortas="b-vigr">vigr</primary>
582 <varlistentry id="vipw">
583 <term><command>vipw</command></term>
585 <para>Edits the <filename>/etc/passwd</filename> or
586 <filename>/etc/shadow</filename> files</para>
587 <indexterm zone="ch-system-shadow vipw">
588 <primary sortas="b-vipw">vipw</primary>