source: chapter06/shadow.xml@ 90bfa70

Last change on this file since 90bfa70 was 6a0e6f3, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • Remove the spurious <info> tags that I thought were necessary but evidently aren't

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