source: chapter06/shadow.xml@ a66ea2b

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since a66ea2b was 85bbe03, checked in by Jeremy Utley <jeremy@…>, 20 years ago

Upgraded a lot of packages - automake, man-pages, shadow, findutils, linux, libc-headers, zlib, udev, iproute2

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

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