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