source: chapter06/shadow.xml@ 1dc34de7

6.0
Last change on this file since 1dc34de7 was ef13657, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Completed global edits for upcoming 6.0 release

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

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