source: chapter06/shadow.xml@ e4bf4c7

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.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/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since e4bf4c7 was 6820da0, checked in by Zack Winkles <winkie@…>, 20 years ago

Moved passwd to /bin

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

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