source: chapter06/shadow.xml@ 0c43171

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 6.0 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/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 0c43171 was 673b0d8, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • Merged newxml into HEAD

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

  • Property mode set to 100644
File size: 13.0 KB
Line 
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]>
6<sect1 id="ch-system-shadow" xreflabel="Shadow">
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>
11
12<para>The Shadow package contains programs for handling passwords in a secure
13way.</para>
14
15<screen>&buildtime; 0.4 SBU
16&diskspace; 11 MB</screen>
17
18<para>Shadow installation depends on: Bash, Binutils, Bison, Coreutils,
19Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed.</para>
20
21
22
23<sect2>
24<title>Installation of Shadow</title>
25
26<para>Shadow hard-wires the path to the <command>passwd</command> binary within
27the binary itself, but does this the wrong way. If a <command>passwd</command>
28binary is not present before installing Shadow, the package incorrectly assumes
29it is going to be located at <filename>/bin/passwd</filename>, but then
30installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
31about not finding <filename>/bin/passwd</filename>. To work around this bug,
32create a dummy <filename>passwd</filename> file, so that it gets hard-wired
33properly:</para>
34
35<screen><userinput>touch /usr/bin/passwd</userinput></screen>
36
37<para>Now prepare Shadow for compilation:</para>
38
39<screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
40
41<para>Work around a problem that prevents Shadow's internationalization from
42working:</para>
43
44<screen><userinput>echo '#define HAVE_SETLOCALE 1' &gt;&gt; config.h</userinput></screen>
45
46<para>Compile the package:</para>
47
48<screen><userinput>make</userinput></screen>
49
50<para>Then install it:</para>
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
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,
61which also allows passwords longer than 8 characters. We also need to
62change the obsolete <filename class="directory">/var/spool/mail</filename>
63location for user mailboxes that Shadow uses by default to the <filename
64class="directory">/var/mail</filename> location used currently. We accomplish
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
69<screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
70 -e 's%/var/spool/mail%/var/mail%' \
71 etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
72
73<para>Move some misplaced symlinks to their proper locations:</para>
74
75<screen><userinput>mv /bin/sg /usr/bin
76mv /bin/vigr /usr/sbin</userinput></screen>
77
78<para>And move Shadow's dynamic libraries to a more appropriate location:</para>
79
80<screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
81
82<para>As some packages expect to find the just-moved libraries in
83<filename>/usr/lib</filename>, create the following symlinks:</para>
84
85<screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
86ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
87
88<para>The -D option of the <filename>useradd</filename> program requires this
89directory for it to work properly:</para>
90
91<screen><userinput>mkdir /etc/default</userinput></screen>
92
93<para>Coreutils has already installed a better <command>groups</command>
94program in <filename class="directory">/usr/bin</filename>. Remove the one
95installed by Shadow:</para>
96
97<screen><userinput>rm /bin/groups</userinput></screen>
98
99</sect2>
100
101
102<sect2 id="conf-shadow"><title>Configuring Shadow</title>
103<indexterm zone="conf-shadow">
104<primary sortas="a-Shadow">Shadow</primary>
105<secondary>configuring</secondary></indexterm>
106
107<para>This package contains utilities to add, modify and delete users and
108groups, set and change their passwords, and other such administrative tasks.
109For a full explanation of what <emphasis>password shadowing</emphasis> means,
110see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
111There's one thing to keep in mind if you decide to use Shadow support: programs
112that need to verify passwords (display managers, ftp programs, pop3 daemons,
113and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
114need to be able to work with shadowed passwords.</para>
115
116<para>To enable shadowed passwords, run the following command:</para>
117
118<screen><userinput>pwconv</userinput></screen>
119
120<para>To enable shadowed group passwords, run:</para>
121
122<screen><userinput>grpconv</userinput></screen>
123
124<para>Under normal circumstances, you won't have created any passwords yet.
125However, if returning to this section later to enable shadowing, you should
126reset any current user passwords with the <command>passwd</command> command or
127any group passwords with the <command>gpasswd</command> command.</para>
128
129</sect2>
130
131
132<sect2>
133<title>Setting the root password</title>
134
135<para>Choose a password for user root and set it via:</para>
136
137<screen><userinput>passwd root</userinput></screen>
138
139</sect2>
140
141
142<sect2 id="contents-shadow"><title>Contents of Shadow</title>
143
144<para><emphasis>Installed programs</emphasis>: chage, chfn, chpasswd, chsh,
145dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck,
146grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers,
147passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod,
148vigr (link to vipw) and vipw</para>
149
150</sect2>
151
152<sect2><title>Short descriptions</title>
153
154<indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
155<para id="chage"><command>chage</command> is used to change the maximum number of
156days between obligatory password changes.</para>
157
158<indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
159<para id="chfn"><command>chfn</command> is used to change a user's full name and
160some other info.</para>
161
162<indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
163<para id="chpasswd"><command>chpasswd</command> is used to update the passwords of a
164whole series of user accounts in one go.</para>
165
166<indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
167<para id="chsh"><command>chsh</command> is used to change a user's default
168 login shell.</para>
169
170<indexterm zone="ch-system-shadow dpasswd"><primary sortas="b-dpasswd">dpasswd</primary></indexterm>
171<para id="dpasswd"><command>dpasswd</command> is used to change dial-up passwords for
172user login shells.</para>
173
174<indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
175<para id="expiry"><command>expiry</command> checks and enforces the current password
176expiration policy.</para>
177
178<indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
179<para id="faillog"><command>faillog</command> is used to examine the log of login
180failures, to set a maximum number of failures before an account is blocked,
181or to reset the failure count.</para>
182
183<indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
184<para id="gpasswd"><command>gpasswd</command> is used to add and delete members and
185administrators to groups.</para>
186
187<indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
188<para id="groupadd"><command>groupadd</command> creates a group with the given
189name.</para>
190
191<indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
192<para id="groupdel"><command>groupdel</command> deletes the group with the given
193name.</para>
194
195<indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
196<para id="groupmod"><command>groupmod</command> is used to modify the given group's
197name or GID.</para>
198
199<indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
200<para id="groups"><command>groups</command> reports the groups of which the given
201users are members.</para>
202
203<indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
204<para id="grpck"><command>grpck</command> verifies the integrity of the group files,
205<filename>/etc/group</filename> and <filename>/etc/gshadow</filename>.</para>
206
207<indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
208<para id="grpconv"><command>grpconv</command> creates or updates the shadow group file
209from the normal group file.</para>
210
211<indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
212<para id="grpunconv"><command>grpunconv</command> updates <filename>/etc/group</filename>
213from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
214
215<indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
216<para id="lastlog"><command>lastlog</command> reports the most recent login of all
217users, or of a given user.</para>
218
219<indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
220<para id="login"><command>login</command> is used by the system to let users sign on.</para>
221
222<indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
223<para id="logoutd"><command>logoutd</command> is a daemon used to enforce restrictions
224on log-on time and ports.</para>
225
226<indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
227<para id="mkpasswd"><command>mkpasswd</command> encrypts the given password using the
228also given perturbation.</para>
229
230<indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
231<para id="newgrp"><command>newgrp</command> is used to change the current GID during
232a login session.</para>
233
234<indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
235<para id="newusers"><command>newusers</command> is used to create or update a whole
236series of user accounts in one go.</para>
237
238<indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
239<para id="passwd"><command>passwd</command> is used to change the password for a user
240or group account.</para>
241
242<indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
243<para id="pwck"><command>pwck</command> verifies the integrity of the password files,
244<filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
245
246<indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
247<para id="pwconv"><command>pwconv</command> creates or updates the shadow password file
248from the normal password file.</para>
249
250<indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
251<para id="pwunconv"><command>pwunconv</command> updates <filename>/etc/passwd</filename>
252from <filename>/etc/shadow</filename> and then deletes the latter.</para>
253
254<indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
255<para id="sg"><command>sg</command> executes a given command while the user's GID
256is set to that of the given group.</para>
257
258<indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
259<para id="useradd"><command>useradd</command> creates a new user with the given name,
260or updates the default new-user information.</para>
261
262<indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
263<para id="userdel"><command>userdel</command> deletes the given user account.</para>
264
265<indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
266<para id="usermod"><command>usermod</command> is used to modify the given user's
267login name, UID (User Identification), shell, initial group, home directory, and the like.</para>
268
269<indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
270<para id="vigr"><command>vigr</command> can be used to edit the
271<filename>/etc/group</filename> or <filename>/etc/gshadow</filename>
272files.</para>
273
274<indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
275<para id="vipw"><command>vipw</command> can be used to edit the
276<filename>/etc/passwd</filename> or <filename>/etc/shadow</filename>
277files.</para>
278
279<indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
280<para id="libmisc"><command>libmisc</command>...</para>
281
282<indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
283<para id="libshadow"><command>libshadow</command> contains functions used by most
284programs in this package.</para>
285
286</sect2>
287
288
289
290</sect1>
Note: See TracBrowser for help on using the repository browser.