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:</para>
55 <screen><userinput remap="pre">sed -i 's/groups$(EXEEXT) //' src/Makefile.in
56 find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;</userinput></screen>
58 <para id="shadow-login_defs">Instead of using the default
59 <emphasis>crypt</emphasis> method, use the more secure
60 <emphasis>SHA-512</emphasis> method of password encryption, which also
61 allows passwords longer than 8 characters. It is also necessary to change
62 the obsolete <filename class="directory">/var/spool/mail</filename> location
63 for user mailboxes that Shadow uses by default to the <filename
64 class="directory">/var/mail</filename> location used currently:</para>
66 <screen><userinput remap="configure">sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \
67 -e 's@/var/spool/mail@/var/mail@' etc/login.defs</userinput></screen>
70 <para>If you chose to build Shadow with Cracklib support, run the following:</para>
72 <screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs</userinput></screen>
75 <para>Make a minor change to make the default useradd consistent with the LFS
78 <screen><userinput remap="pre">sed -i 's/1000/999/' etc/useradd</userinput></screen>
80 <para>Prepare Shadow for compilation:</para>
82 <screen><userinput remap="configure">./configure --sysconfdir=/etc --with-group-name-max-length=32</userinput></screen>
85 <title>The meaning of the configure option:</title>
88 <term><parameter>--with-group-name-max-length=32</parameter></term>
90 <para>The maximum user name is 32 characters. Make the maximum
91 group name the same.</para>
97 <para>Compile the package:</para>
99 <screen><userinput remap="make">make</userinput></screen>
101 <para>This package does not come with a test suite.</para>
103 <para>Install the package:</para>
105 <screen><userinput remap="install">make install</userinput></screen>
107 <para>Move a misplaced program to its proper location:</para>
109 <screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
111 <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
113 <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
114 rm -v /lib/libshadow.so
115 ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
119 <sect2 id="conf-shadow" role="configuration">
120 <title>Configuring Shadow</title>
122 <indexterm zone="conf-shadow">
123 <primary sortas="a-Shadow">Shadow</primary>
124 <secondary>configuring</secondary>
127 <para>This package contains utilities to add, modify, and delete users and
128 groups; set and change their passwords; and perform other administrative
129 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
130 means, see the <filename>doc/HOWTO</filename> file within the unpacked
131 source tree. If using Shadow support, keep in mind that programs which need
132 to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
133 must be Shadow-compliant. That is, they need to be able to work with
134 shadowed passwords.</para>
136 <para>To enable shadowed passwords, run the following command:</para>
138 <screen><userinput>pwconv</userinput></screen>
140 <para>To enable shadowed group passwords, run:</para>
142 <screen><userinput>grpconv</userinput></screen>
144 <para>Shadow's stock configuration for the <command>useradd</command>
145 utility has a few caveats that need some explanation. First, the default
146 action for the <command>useradd</command> utility is to create the user and
147 a group of the same name as the user. By default the user ID (UID) and
148 group ID (GID) numbers will begin with 1000. This means if you don't pass
149 parameters to <command>useradd</command>, each user will be a member of a
150 unique group on the system. If this behavior is undesirable, you'll need
151 to pass the <parameter>-g</parameter> parameter to
152 <command>useradd</command>. The default parameters are stored in the
153 <filename>/etc/default/useradd</filename> file. You may need to modify two
154 parameters in this file to suit your particular needs.</para>
157 <title><filename>/etc/default/useradd</filename> Parameter Explanations</title>
160 <term><parameter>GROUP=1000</parameter></term>
162 <para>This parameter sets the beginning of the group numbers used in
163 the /etc/group file. You can modify it to anything you desire. Note
164 that <command>useradd</command> will never reuse a UID or GID. If the
165 number identified in this parameter is used, it will use the next
166 available number after this. Note also that if you don't have a group
167 1000 on your system the first time you use <command>useradd</command>
168 without the <parameter>-g</parameter> parameter, you'll get a message
169 displayed on the terminal that says:
170 <computeroutput>useradd: unknown GID 1000</computeroutput>. You may
171 disregard this message and group number 1000 will be used.</para>
175 <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
177 <para>This parameter causes <command>useradd</command> to create a
178 mailbox file for the newly created user. <command>useradd</command>
179 will make the group ownership of this file to the
180 <systemitem class="groupname">mail</systemitem> group with 0660
181 permissions. If you would prefer that these mailbox files are not
182 created by <command>useradd</command>, issue the following
185 <screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
194 <sect2 role="configuration">
195 <title>Setting the root password</title>
197 <para>Choose a password for user <emphasis>root</emphasis> and set it
200 <screen role="nodump"><userinput>passwd root</userinput></screen>
204 <sect2 id="contents-shadow" role="content">
205 <title>Contents of Shadow</title>
208 <segtitle>Installed programs</segtitle>
209 <segtitle>Installed directory</segtitle>
212 <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
213 groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
214 lastlog, login, logoutd, newgidmap, newgrp,newuidmap, newusers,
215 nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su,
216 useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
217 <seg>/etc/default</seg>
222 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
223 <?dbfo list-presentation="list"?>
224 <?dbhtml list-presentation="table"?>
226 <varlistentry id="chage">
227 <term><command>chage</command></term>
229 <para>Used to change the maximum number of days between obligatory
230 password changes</para>
231 <indexterm zone="ch-system-shadow chage">
232 <primary sortas="b-chage">chage</primary>
237 <varlistentry id="chfn">
238 <term><command>chfn</command></term>
240 <para>Used to change a user's full name and other information</para>
241 <indexterm zone="ch-system-shadow chfn">
242 <primary sortas="b-chfn">chfn</primary>
247 <varlistentry id="chgpasswd">
248 <term><command>chgpasswd</command></term>
250 <para>Used to update group passwords in batch mode</para>
251 <indexterm zone="ch-system-shadow chgpasswd">
252 <primary sortas="b-chgpasswd">chgpasswd</primary>
257 <varlistentry id="chpasswd">
258 <term><command>chpasswd</command></term>
260 <para>Used to update user passwords in batch mode</para>
261 <indexterm zone="ch-system-shadow chpasswd">
262 <primary sortas="b-chpasswd">chpasswd</primary>
267 <varlistentry id="chsh">
268 <term><command>chsh</command></term>
270 <para>Used to change a user's default login shell</para>
271 <indexterm zone="ch-system-shadow chsh">
272 <primary sortas="b-chsh">chsh</primary>
277 <varlistentry id="expiry">
278 <term><command>expiry</command></term>
280 <para>Checks and enforces the current password expiration policy</para>
281 <indexterm zone="ch-system-shadow expiry">
282 <primary sortas="b-expiry">expiry</primary>
287 <varlistentry id="faillog">
288 <term><command>faillog</command></term>
290 <para>Is used to examine the log of login failures, to set a maximum
291 number of failures before an account is blocked, or to reset the
293 <indexterm zone="ch-system-shadow faillog">
294 <primary sortas="b-faillog">faillog</primary>
299 <varlistentry id="gpasswd">
300 <term><command>gpasswd</command></term>
302 <para>Is used to add and delete members and administrators to
304 <indexterm zone="ch-system-shadow gpasswd">
305 <primary sortas="b-gpasswd">gpasswd</primary>
310 <varlistentry id="groupadd">
311 <term><command>groupadd</command></term>
313 <para>Creates a group with the given name</para>
314 <indexterm zone="ch-system-shadow groupadd">
315 <primary sortas="b-groupadd">groupadd</primary>
320 <varlistentry id="groupdel">
321 <term><command>groupdel</command></term>
323 <para>Deletes the group with the given name</para>
324 <indexterm zone="ch-system-shadow groupdel">
325 <primary sortas="b-groupdel">groupdel</primary>
330 <varlistentry id="groupmems">
331 <term><command>groupmems</command></term>
333 <para>Allows a user to administer his/her own group membership list
334 without the requirement of super user privileges.</para>
335 <indexterm zone="ch-system-shadow groupmems">
336 <primary sortas="b-groupmems">groupmems</primary>
341 <varlistentry id="groupmod">
342 <term><command>groupmod</command></term>
344 <para>Is used to modify the given group's name or GID</para>
345 <indexterm zone="ch-system-shadow groupmod">
346 <primary sortas="b-groupmod">groupmod</primary>
351 <varlistentry id="grpck">
352 <term><command>grpck</command></term>
354 <para>Verifies the integrity of the group files
355 <filename>/etc/group</filename> and
356 <filename>/etc/gshadow</filename></para>
357 <indexterm zone="ch-system-shadow grpck">
358 <primary sortas="b-grpck">grpck</primary>
363 <varlistentry id="grpconv">
364 <term><command>grpconv</command></term>
366 <para>Creates or updates the shadow group file from the normal
368 <indexterm zone="ch-system-shadow grpconv">
369 <primary sortas="b-grpconv">grpconv</primary>
374 <varlistentry id="grpunconv">
375 <term><command>grpunconv</command></term>
377 <para>Updates <filename>/etc/group</filename> from
378 <filename>/etc/gshadow</filename> and then deletes the latter</para>
379 <indexterm zone="ch-system-shadow grpunconv">
380 <primary sortas="b-grpunconv">grpunconv</primary>
385 <varlistentry id="lastlog">
386 <term><command>lastlog</command></term>
388 <para>Reports the most recent login of all users or of a
390 <indexterm zone="ch-system-shadow lastlog">
391 <primary sortas="b-lastlog">lastlog</primary>
396 <varlistentry id="login">
397 <term><command>login</command></term>
399 <para>Is used by the system to let users sign on</para>
400 <indexterm zone="ch-system-shadow login">
401 <primary sortas="b-login">login</primary>
406 <varlistentry id="logoutd">
407 <term><command>logoutd</command></term>
409 <para>Is a daemon used to enforce restrictions on log-on time
411 <indexterm zone="ch-system-shadow logoutd">
412 <primary sortas="b-logoutd">logoutd</primary>
417 <varlistentry id="newgidmap">
418 <term><command>newgidmap</command></term>
420 <para>Is used to set the gid mapping of a user namespace</para>
421 <indexterm zone="ch-system-shadow newgidmap">
422 <primary sortas="b-newgidmap">newgidmap</primary>
427 <varlistentry id="newgrp">
428 <term><command>newgrp</command></term>
430 <para>Is used to change the current GID during a login session</para>
431 <indexterm zone="ch-system-shadow newgrp">
432 <primary sortas="b-newgrp">newgrp</primary>
437 <varlistentry id="newuidmap">
438 <term><command>newuidmap</command></term>
440 <para>Is used to set the uid mapping of a user namespace</para>
441 <indexterm zone="ch-system-shadow newuidmap">
442 <primary sortas="b-newuidmap">newuidmap</primary>
447 <varlistentry id="newusers">
448 <term><command>newusers</command></term>
450 <para>Is used to create or update an entire series of user
452 <indexterm zone="ch-system-shadow newusers">
453 <primary sortas="b-newusers">newusers</primary>
458 <varlistentry id="nologin">
459 <term><command>nologin</command></term>
461 <para>Displays a message that an account is not available; it is designed
462 to be used as the default shell for accounts that have been
464 <indexterm zone="ch-system-shadow nologin">
465 <primary sortas="b-nologin">nologin</primary>
470 <varlistentry id="passwd">
471 <term><command>passwd</command></term>
473 <para>Is used to change the password for a user or group account</para>
474 <indexterm zone="ch-system-shadow passwd">
475 <primary sortas="b-passwd">passwd</primary>
480 <varlistentry id="pwck">
481 <term><command>pwck</command></term>
483 <para>Verifies the integrity of the password files
484 <filename>/etc/passwd</filename> and
485 <filename>/etc/shadow</filename></para>
486 <indexterm zone="ch-system-shadow pwck">
487 <primary sortas="b-pwck">pwck</primary>
492 <varlistentry id="pwconv">
493 <term><command>pwconv</command></term>
495 <para>Creates or updates the shadow password file from the normal
497 <indexterm zone="ch-system-shadow pwconv">
498 <primary sortas="b-pwconv">pwconv</primary>
503 <varlistentry id="pwunconv">
504 <term><command>pwunconv</command></term>
506 <para>Updates <filename>/etc/passwd</filename> from
507 <filename>/etc/shadow</filename> and then deletes the latter</para>
508 <indexterm zone="ch-system-shadow pwunconv">
509 <primary sortas="b-pwunconv">pwunconv</primary>
514 <varlistentry id="sg">
515 <term><command>sg</command></term>
517 <para>Executes a given command while the user's GID
518 is set to that of the given group</para>
519 <indexterm zone="ch-system-shadow sg">
520 <primary sortas="b-sg">sg</primary>
525 <varlistentry id="su">
526 <term><command>su</command></term>
528 <para>Runs a shell with substitute user and group IDs</para>
529 <indexterm zone="ch-system-shadow su">
530 <primary sortas="b-su">su</primary>
535 <varlistentry id="useradd">
536 <term><command>useradd</command></term>
538 <para>Creates a new user with the given name, or updates the default
539 new-user information</para>
540 <indexterm zone="ch-system-shadow useradd">
541 <primary sortas="b-useradd">useradd</primary>
546 <varlistentry id="userdel">
547 <term><command>userdel</command></term>
549 <para>Deletes the given user account</para>
550 <indexterm zone="ch-system-shadow userdel">
551 <primary sortas="b-userdel">userdel</primary>
556 <varlistentry id="usermod">
557 <term><command>usermod</command></term>
559 <para>Is used to modify the given user's login name, User
560 Identification (UID), shell, initial group, home directory, etc.</para>
561 <indexterm zone="ch-system-shadow usermod">
562 <primary sortas="b-usermod">usermod</primary>
567 <varlistentry id="vigr">
568 <term><command>vigr</command></term>
570 <para>Edits the <filename>/etc/group</filename> or
571 <filename>/etc/gshadow</filename> files</para>
572 <indexterm zone="ch-system-shadow vigr">
573 <primary sortas="b-vigr">vigr</primary>
578 <varlistentry id="vipw">
579 <term><command>vipw</command></term>
581 <para>Edits the <filename>/etc/passwd</filename> or
582 <filename>/etc/shadow</filename> files</para>
583 <indexterm zone="ch-system-shadow vipw">
584 <primary sortas="b-vipw">vipw</primary>