source: chapter06/shadow.xml@ 698a753

Last change on this file since 698a753 was 4917d0c0, checked in by Jim Gifford <jim@…>, 19 years ago

Updates: Thanx Manuel

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