source: chapter06/shadow.xml@ a8f36125

Last change on this file since a8f36125 was a8f36125, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (all) Removed all references to the DocBook DTD
  • (docbook.rng) Added the DocBook "Gin" schema
  • (Makefile) Updated with new validation command
  • (prologue/*) Validation fixes

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