source: chapter06/shadow.xml@ 407d336

Last change on this file since 407d336 was 407d336, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Updated multi-arch branch to current testing.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multi-arch/BOOK@4397 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 14.8 KB
RevLine 
[673b0d8]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
[752f4e5]6<sect1 id="ch-system-shadow" role="wrap">
[673b0d8]7<title>Shadow-&shadow-version;</title>
8<?dbhtml filename="shadow.html"?>
9
10<indexterm zone="ch-system-shadow"><primary sortas="a-Shadow">Shadow</primary></indexterm>
[6370fa6]11
[a001133]12<sect2 role="package"><title/>
[5888299]13<para>The Shadow package contains programs for handling passwords in a secure
14way.</para>
15
[a001133]16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>0.4 SBU</seg><seg>11 MB</seg></seglistitem>
20</segmentedlist>
[673b0d8]21
[a001133]22<segmentedlist>
23<segtitle>Shadow installation depends on</segtitle>
24<seglistitem><seg>Bash, Binutils, Bison, Coreutils,
[69993f4]25Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem>
[a001133]26</segmentedlist>
27</sect2>
[3554fa3a]28
[a001133]29<sect2 role="installation">
[73aedd1d]30<title>Installation of Shadow</title>
31
[6820da0]32<para>Prepare Shadow for compilation:</para>
[73aedd1d]33
[d0a6c4c]34<screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
[73aedd1d]35
36<para>Compile the package:</para>
37
38<screen><userinput>make</userinput></screen>
39
[ef13657]40<para>Install the package:</para>
[73aedd1d]41
42<screen><userinput>make install</userinput></screen>
43
[b7e8981]44<para id="shadow-limits-login_access">Shadow uses two files to configure
45authentication settings for the system. Install these two config files:</para>
46
[a75acee]47<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/limits">/etc/limits</primary></indexterm>
[b7e8981]48<indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/login.access">/etc/login.access</primary></indexterm>
[73aedd1d]49
50<screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
51
[38bb44a]52<beginpage/>
[b7e8981]53<para id="shadow-login_defs">Instead of using the default <emphasis>crypt</emphasis> method,
[ef13657]54use the more secure <emphasis>MD5</emphasis> method of password
55encryption, which also allows passwords longer than 8 characters. It
56is also necessary to change the obsolete <filename
57class="directory">/var/spool/mail</filename> location for user
58mailboxes that Shadow uses by default to the <filename
59class="directory">/var/mail</filename> location used currently. Both
60of these can be accomplished by changing the relevant configuration
61file while copying it to its destination:</para>
[c21999c6]62
[b7e8981]63<indexterm zone="shadow-login_defs"><primary sortas="e-/etc/login.defs">/etc/login.defs</primary></indexterm>
64
[2ec4b60]65<screen><userinput>cp etc/login.defs.linux /etc/login.defs
66sed -i -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
[8dffa04]67 -e 's@/var/spool/mail@/var/mail@' /etc/login.defs</userinput></screen>
[73aedd1d]68
[407d336]69<para>Move a misplaced program to their proper
70location:</para>
[73aedd1d]71
[407d336]72<screen><userinput>mv /usr/bin/passwd /bin</userinput></screen>
[73aedd1d]73
[ef13657]74<para>Move Shadow's dynamic libraries to a more appropriate
75location:</para>
[73aedd1d]76
[407d336]77<screen><userinput>mv /usr/lib/libshadow.so.0* /lib</userinput></screen>
[73aedd1d]78
[ef13657]79<para>Because some packages expect to find the just-moved libraries in
80<filename class="directory">/usr/lib</filename>, create the following
[407d336]81symlink:</para>
[73aedd1d]82
[407d336]83<screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
[73aedd1d]84
[ef13657]85<para>The <parameter>-D</parameter> option of the
86<command>useradd</command> program requires the <filename
87class="directory">/etc/default</filename> directory for it to work
88properly:</para>
[638a816e]89
90<screen><userinput>mkdir /etc/default</userinput></screen>
91
[ef13657]92<para>Coreutils has already installed a better
93<command>groups</command> program in <filename
94class="directory">/usr/bin</filename>. Remove the one installed by
95Shadow:</para>
[73aedd1d]96
97<screen><userinput>rm /bin/groups</userinput></screen>
[2256873]98<beginpage/>
[73aedd1d]99</sect2>
[24351aa]100
[2309b72]101
[df8334f]102<sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
[673b0d8]103<indexterm zone="conf-shadow">
104<primary sortas="a-Shadow">Shadow</primary>
105<secondary>configuring</secondary></indexterm>
[2309b72]106
[ef13657]107<para>This package contains utilities to add, modify, and delete users
108and groups; set and change their passwords; and perform other
109administrative tasks. For a full explanation of what
110<emphasis>password shadowing</emphasis> means, see the
111<filename>doc/HOWTO</filename> file within the unpacked source tree.
112If using Shadow support, keep in mind that programs which need to
[69993f4]113verify passwords (display managers, FTP programs, pop3 daemons, etc.)
114must be shadow-compliant. That is, they need to be able to work with
[ef13657]115shadowed passwords.</para>
[2309b72]116
117<para>To enable shadowed passwords, run the following command:</para>
118
[cd1ddd7]119<screen><userinput>pwconv</userinput></screen>
[2309b72]120
[673b0d8]121<para>To enable shadowed group passwords, run:</para>
[2309b72]122
[cd1ddd7]123<screen><userinput>grpconv</userinput></screen>
[2309b72]124
[ef13657]125<para>Under normal circumstances, passwords will not have been created
126yet. However, if returning to this section later to enable shadowing,
127reset any current user passwords with the <command>passwd</command>
128command or any group passwords with the <command>gpasswd</command>
129command.</para>
[c21999c6]130
[2309b72]131</sect2>
132
[c21999c6]133
[df8334f]134<sect2 role="configuration">
[2309b72]135<title>Setting the root password</title>
136
[ef13657]137<para>Choose a password for user <emphasis>root</emphasis> and set it
138by running:</para>
[2309b72]139
140<screen><userinput>passwd root</userinput></screen>
[2256873]141<beginpage/>
[2309b72]142</sect2>
[24351aa]143
[5888299]144
[c6cb3aa]145<sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
[673b0d8]146
[c6cb3aa]147<segmentedlist>
148<segtitle>Installed programs</segtitle>
[69993f4]149<segtitle>Installed libraries</segtitle>
[35ee31b]150<seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
151groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login,
152logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg
[69993f4]153(link to newgrp), useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
154<seg>libshadow[.a,so]</seg>
[35ee31b]155</seglistitem>
[c6cb3aa]156</segmentedlist>
[673b0d8]157
[2256873]158<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
[3ed279f]159<?dbfo list-presentation="list"?>
[673b0d8]160
[b8a819f]161<varlistentry id="chage">
162<term><command>chage</command></term>
[c6cb3aa]163<listitem>
[2256873]164<para>Used to change the maximum number of days between obligatory
165password changes</para>
[3ed279f]166<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
[c6cb3aa]167</listitem>
168</varlistentry>
[673b0d8]169
[b8a819f]170<varlistentry id="chfn">
171<term><command>chfn</command></term>
[c6cb3aa]172<listitem>
[2256873]173<para>Used to change a user's full name and other info</para>
[3ed279f]174<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
[c6cb3aa]175</listitem>
176</varlistentry>
[673b0d8]177
[b8a819f]178<varlistentry id="chpasswd">
179<term><command>chpasswd</command></term>
[c6cb3aa]180<listitem>
[2256873]181<para>Used to update the passwords of an entire series of user
182accounts</para>
[3ed279f]183<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
[c6cb3aa]184</listitem>
185</varlistentry>
[673b0d8]186
[b8a819f]187<varlistentry id="chsh">
188<term><command>chsh</command></term>
[c6cb3aa]189<listitem>
[2256873]190<para>Used to change a user's default login shell</para>
[3ed279f]191<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
[c6cb3aa]192</listitem>
193</varlistentry>
[673b0d8]194
[b8a819f]195<varlistentry id="expiry">
196<term><command>expiry</command></term>
[c6cb3aa]197<listitem>
[2256873]198<para>Checks and enforces the current password expiration policy</para>
[3ed279f]199<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
[c6cb3aa]200</listitem>
201</varlistentry>
[673b0d8]202
[b8a819f]203<varlistentry id="faillog">
204<term><command>faillog</command></term>
[c6cb3aa]205<listitem>
[2256873]206<para>Is used to examine the log of login failures, to set a maximum number of
207failures before an account is blocked, or to reset the failure count</para>
[3ed279f]208<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
[c6cb3aa]209</listitem>
210</varlistentry>
211
[b8a819f]212<varlistentry id="gpasswd">
213<term><command>gpasswd</command></term>
[c6cb3aa]214<listitem>
[2256873]215<para>Is used to add and delete members and administrators to groups</para>
[3ed279f]216<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
[c6cb3aa]217</listitem>
218</varlistentry>
[673b0d8]219
[b8a819f]220<varlistentry id="groupadd">
221<term><command>groupadd</command></term>
[c6cb3aa]222<listitem>
[2256873]223<para>Creates a group with the given name</para>
[3ed279f]224<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
[c6cb3aa]225</listitem>
226</varlistentry>
[673b0d8]227
[b8a819f]228<varlistentry id="groupdel">
229<term><command>groupdel</command></term>
[c6cb3aa]230<listitem>
[2256873]231<para>Deletes the group with the given name</para>
[3ed279f]232<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
[c6cb3aa]233</listitem>
234</varlistentry>
[673b0d8]235
[b8a819f]236<varlistentry id="groupmod">
237<term><command>groupmod</command></term>
[c6cb3aa]238<listitem>
[2256873]239<para>Is used to modify the given group's name or GID</para>
[3ed279f]240<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
[c6cb3aa]241</listitem>
242</varlistentry>
[673b0d8]243
[b8a819f]244<varlistentry id="groups">
245<term><command>groups</command></term>
[c6cb3aa]246<listitem>
[2256873]247<para>Reports the groups of which the given users are members</para>
[3ed279f]248<indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
[c6cb3aa]249</listitem>
250</varlistentry>
[673b0d8]251
[b8a819f]252<varlistentry id="grpck">
253<term><command>grpck</command></term>
[c6cb3aa]254<listitem>
[2256873]255<para>Verifies the integrity of the group files <filename>/etc/group</filename>
256and <filename>/etc/gshadow</filename></para>
[b7e8981]257<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
[c6cb3aa]258</listitem>
259</varlistentry>
260
[b8a819f]261<varlistentry id="grpconv">
262<term><command>grpconv</command></term>
[c6cb3aa]263<listitem>
[2256873]264<para>Creates or updates the shadow group file from the normal group file</para>
[3ed279f]265<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
[c6cb3aa]266</listitem>
267</varlistentry>
[673b0d8]268
[b8a819f]269<varlistentry id="grpunconv">
270<term><command>grpunconv</command></term>
[c6cb3aa]271<listitem>
[2256873]272<para>Updates <filename>/etc/group</filename>
273from <filename>/etc/gshadow</filename> and then deletes the latter</para>
[3ed279f]274<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
[c6cb3aa]275</listitem>
276</varlistentry>
[673b0d8]277
[b8a819f]278<varlistentry id="lastlog">
279<term><command>lastlog</command></term>
[c6cb3aa]280<listitem>
[2256873]281<para>Reports the most recent login of all users or of a given user</para>
[3ed279f]282<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
[c6cb3aa]283</listitem>
284</varlistentry>
[73aedd1d]285
[b8a819f]286<varlistentry id="login">
287<term><command>login</command></term>
[c6cb3aa]288<listitem>
[2256873]289<para>Is used by the system to let users sign on</para>
[3ed279f]290<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
[c6cb3aa]291</listitem>
292</varlistentry>
[673b0d8]293
[b8a819f]294<varlistentry id="logoutd">
295<term><command>logoutd</command></term>
[c6cb3aa]296<listitem>
[2256873]297<para>Is a daemon used to enforce restrictions on log-on time and ports</para>
[3ed279f]298<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
[c6cb3aa]299</listitem>
300</varlistentry>
[673b0d8]301
[b8a819f]302<varlistentry id="mkpasswd">
303<term><command>mkpasswd</command></term>
[c6cb3aa]304<listitem>
[2256873]305<para>Generates random passwords</para>
[3ed279f]306<indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
[c6cb3aa]307</listitem>
308</varlistentry>
[673b0d8]309
[b8a819f]310<varlistentry id="newgrp">
311<term><command>newgrp</command></term>
[c6cb3aa]312<listitem>
[2256873]313<para>Is used to change the current GID during a login session</para>
[3ed279f]314<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
[c6cb3aa]315</listitem>
316</varlistentry>
[673b0d8]317
[b8a819f]318<varlistentry id="newusers">
319<term><command>newusers</command></term>
[c6cb3aa]320<listitem>
[2256873]321<para>Is used to create or update an entire series of user accounts</para>
[3ed279f]322<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
[c6cb3aa]323</listitem>
324</varlistentry>
[673b0d8]325
[b8a819f]326<varlistentry id="passwd">
327<term><command>passwd</command></term>
[c6cb3aa]328<listitem>
[2256873]329<para>Is used to change the password for a user or group account</para>
[3ed279f]330<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
[c6cb3aa]331</listitem>
332</varlistentry>
[673b0d8]333
[b8a819f]334<varlistentry id="pwck">
335<term><command>pwck</command></term>
[c6cb3aa]336<listitem>
[2256873]337<para>Verifies the integrity of the password files
338<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename></para>
[3ed279f]339<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
[c6cb3aa]340</listitem>
341</varlistentry>
[673b0d8]342
[b8a819f]343<varlistentry id="pwconv">
344<term><command>pwconv</command></term>
[c6cb3aa]345<listitem>
[2256873]346<para>Creates or updates the shadow password file from the normal
347password file</para>
[3ed279f]348<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
[c6cb3aa]349</listitem>
350</varlistentry>
[673b0d8]351
[b8a819f]352<varlistentry id="pwunconv">
353<term><command>pwunconv</command></term>
[c6cb3aa]354<listitem>
[2256873]355<para>Updates <filename>/etc/passwd</filename>
356from <filename>/etc/shadow</filename> and then deletes the latter</para>
[3ed279f]357<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
[c6cb3aa]358</listitem>
359</varlistentry>
[673b0d8]360
[b8a819f]361<varlistentry id="sg">
362<term><command>sg</command></term>
[c6cb3aa]363<listitem>
[2256873]364<para>Executes a given command while the user's GID
365is set to that of the given group</para>
[3ed279f]366<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
[c6cb3aa]367</listitem>
368</varlistentry>
[673b0d8]369
[7624c05]370<varlistentry id="su">
371<term><command>su</command></term>
372<listitem>
373<indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
[2256873]374<para>Runs a shell with substitute user and group IDs</para>
[7624c05]375</listitem>
376</varlistentry>
377
[b8a819f]378<varlistentry id="useradd">
379<term><command>useradd</command></term>
[c6cb3aa]380<listitem>
[2256873]381<para>Creates a new user with the given name, or updates the default
382new-user information</para>
[3ed279f]383<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
[c6cb3aa]384</listitem>
385</varlistentry>
[673b0d8]386
[b8a819f]387<varlistentry id="userdel">
388<term><command>userdel</command></term>
[c6cb3aa]389<listitem>
[2256873]390<para>Deletes the given user account</para>
[3ed279f]391<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
[c6cb3aa]392</listitem>
393</varlistentry>
[673b0d8]394
[b8a819f]395<varlistentry id="usermod">
396<term><command>usermod</command></term>
[c6cb3aa]397<listitem>
[2256873]398<para>Is used to modify the given user's login name, User
[69993f4]399Identification (UID),
[ef13657]400shell, initial group, home directory, etc.</para>
[3ed279f]401<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
[c6cb3aa]402</listitem>
403</varlistentry>
404
[b8a819f]405<varlistentry id="vigr">
406<term><command>vigr</command></term>
[c6cb3aa]407<listitem>
[2256873]408<para>Edits the <filename>/etc/group</filename> or
409<filename>/etc/gshadow</filename> files</para>
[3ed279f]410<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
[c6cb3aa]411</listitem>
412</varlistentry>
413
[b8a819f]414<varlistentry id="vipw">
415<term><command>vipw</command></term>
[c6cb3aa]416<listitem>
[2256873]417<para>Edits the <filename>/etc/passwd</filename> or
418<filename>/etc/shadow</filename> files</para>
[3ed279f]419<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
[c6cb3aa]420</listitem>
421</varlistentry>
422
[b8a819f]423<varlistentry id="libshadow">
[8ad7980]424<term><filename class="libraryfile">libshadow</filename></term>
[c6cb3aa]425<listitem>
[2256873]426<para>Contains functions used by most programs in this package</para>
[3ed279f]427<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
[c6cb3aa]428</listitem>
429</varlistentry>
430</variablelist>
[673b0d8]431
432</sect2>
433
434</sect1>
[ef13657]435
Note: See TracBrowser for help on using the repository browser.