source: BOOK/final-system/common/shadow.xml@ f6420ad

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f6420ad was 52704239, checked in by Jim Gifford <clfs@…>, 19 years ago

r3612@server (orig r1643): chris | 2006-05-25 09:49:42 -0700
Minor updates to shadow instructions

  • Property mode set to 100644
File size: 18.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-shadow" role="wrap">
9 <?dbhtml filename="shadow.html"?>
10
11 <title>Shadow-&shadow-version;</title>
12
13 <indexterm zone="ch-system-shadow">
14 <primary sortas="a-Shadow">Shadow</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Shadow package contains programs for handling passwords in a
21 secure way.</para>
22
23 </sect2>
24
25 <sect2 role="installation">
26 <title>Installation of Shadow</title>
27
28 <note os="a">
29 <para>If you would like to enforce the use of strong passwords,
30 refer to <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/>
31 for installing Cracklib prior to building Shadow. Then add
32 <parameter>--with-libcrack</parameter> to the <command>configure</command>
33 command below.</para>
34 </note>
35
36 <para os="b">Prepare Shadow for compilation:</para>
37
38<screen os="c"><userinput>./configure --libdir=/lib --enable-shared \
39 --without-libpam --without-audit --without-selinux</userinput></screen>
40
41<para os="d">The meaning of the configure options:</para>
42
43 <variablelist os="e">
44 <varlistentry>
45 <term><parameter>--without-libpam</parameter></term>
46 <listitem><para>Support for Linux-PAM is enabled by default in Shadow,
47 however PAM is not installed on a base LFS system, so this switch
48 disables PAM support in Shadow. For instructions to install PAM and
49 link Shadow to it, you can look at
50 <ulink url="&blfs-root;view/svn/postlfs/shadow.html"/>.</para></listitem>
51 </varlistentry>
52 <varlistentry>
53 <term><parameter>--without-audit</parameter></term>
54 <listitem><para>Support for auditing is enabled by default, but a
55 a library that it needs is not installed in a base LFS system. This
56 switch disables auditing support.</para></listitem>
57 </varlistentry>
58 <varlistentry>
59 <term><parameter>--without-selinux</parameter></term>
60 <listitem><para>Support for selinux is enabled by default, but selinux
61 is not built in a base LFS system and configure will fail without this
62 switch.</para></listitem>
63 </varlistentry>
64 </variablelist>
65
66 <para os="f">Disable the installation of the <command>groups</command>
67 program and its man pages, as Coreutils provides a better version:</para>
68
69<screen os="g"><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile
70sed -i '/groups/d' man/Makefile</userinput></screen>
71
72 <para os="h">Compile the package:</para>
73
74<screen os="i"><userinput>make</userinput></screen>
75
76 <para os="j">This package does not come with a test suite.</para>
77
78 <para os="k">Install the package:</para>
79
80<screen os="l"><userinput>make install</userinput></screen>
81
82 <para id="shadow-limits-login_access" os="m">Shadow uses two files to configure
83 authentication settings for the system. Install these two configuration
84 files:</para>
85
86 <indexterm zone="shadow-limits-login_access" os="n">
87 <primary sortas="e-/etc/limits">/etc/limits</primary>
88 </indexterm>
89
90 <indexterm zone="shadow-limits-login_access" os="o">
91 <primary sortas="e-/etc/login.access">/etc/login.access</primary>
92 </indexterm>
93
94<screen os="p"><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen>
95
96 <para id="shadow-login_defs" os="q">Instead of using the default
97 <emphasis>crypt</emphasis> method, use the more secure
98 <emphasis>MD5</emphasis> method of password encryption, which also allows
99 passwords longer than 8 characters. It is also necessary to change the
100 obsolete <filename class="directory">/var/spool/mail</filename> location
101 for user mailboxes that Shadow uses by default to the <filename
102 class="directory">/var/mail</filename> location used currently. Both of
103 these can be accomplished by changing the relevant configuration file
104 while copying it to its destination:</para>
105
106 <indexterm zone="shadow-login_defs" os="r">
107 <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
108 </indexterm>
109
110<screen os="s"><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
111 -e 's@/var/spool/mail@/var/mail@' \
112 etc/login.defs &gt; /etc/login.defs</userinput></screen>
113
114 <note os="t">
115 <para>If you built Shadow with Cracklib support, execute
116 this <command>sed</command> to correct the path to the Cracklib
117 dictionary:</para>
118
119<screen><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' /etc/login.defs</userinput></screen>
120 </note>
121
122 <para os="u">Move a misplaced program to its proper location:</para>
123
124<screen os="v"><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
125
126 <para os="w">Move Shadow's dynamic libraries to a more appropriate
127 location:</para>
128
129<screen os="x"><userinput>mv -v /lib/libshadow.*a /usr/lib
130rm -v /lib/libshadow.so
131ln -svf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
132
133 <para os="y">The <option>-D</option> option of the <command>useradd</command>
134 program requires the <filename class="directory">/etc/default</filename>
135 directory for it to work properly:</para>
136
137<screen os="z"><userinput>install -dv /etc/default</userinput></screen>
138
139 </sect2>
140
141 <sect2 id="conf-shadow" role="configuration">
142 <title>Configuring Shadow</title>
143
144 <indexterm zone="conf-shadow">
145 <primary sortas="a-Shadow">Shadow</primary>
146 <secondary>configuring</secondary>
147 </indexterm>
148
149 <para>This package contains utilities to add, modify, and delete users and
150 groups; set and change their passwords; and perform other administrative
151 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
152 means, see the <filename>doc/HOWTO</filename> file within the unpacked source
153 tree. If using Shadow support, keep in mind that programs which need to
154 verify passwords (display managers, FTP programs, pop3 daemons, etc.) must
155 be Shadow-compliant. That is, they need to be able to work with shadowed
156 passwords.</para>
157
158 <para>To enable shadowed passwords, run the following command:</para>
159
160<screen><userinput>pwconv</userinput></screen>
161
162 <para>To enable shadowed group passwords, run:</para>
163
164<screen role="nodump"><userinput>grpconv</userinput></screen>
165
166 <para>Under normal circumstances, passwords will not have been created
167 yet. However, if returning to this section later to enable shadowing,
168 reset any current user passwords with the <command>passwd</command>
169 command or any group passwords with the <command>gpasswd</command>
170 command.</para>
171
172 </sect2>
173
174 <sect2 id="root-password" role="configuration">
175 <title>Setting the root password</title>
176
177 <para>Choose a password for user <systemitem
178 class="username">root</systemitem> and set it by running:</para>
179
180<screen role="nodump"><userinput>passwd root</userinput></screen>
181
182 </sect2>
183
184 <sect2 id="contents-shadow" role="content">
185 <title>Contents of Shadow</title>
186
187 <segmentedlist>
188 <segtitle>Installed programs</segtitle>
189 <segtitle>Installed libraries</segtitle>
190
191 <seglistitem>
192 <seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd, groupadd,
193 groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login,
194 logoutd, newgrp, newusers, passwd, pwck, pwconv, pwunconv,
195 sg (link to newgrp), useradd, userdel, usermod, vigr (link to vipw),
196 and vipw</seg>
197 <seg>libshadow.[a,so]</seg>
198 </seglistitem>
199 </segmentedlist>
200
201 <variablelist>
202 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
203 <?dbfo list-presentation="list"?>
204 <?dbhtml list-presentation="table"?>
205
206 <varlistentry id="chage">
207 <term><command>chage</command></term>
208 <listitem>
209 <para>Used to change the maximum number of days between obligatory
210 password changes</para>
211 <indexterm zone="ch-system-shadow chage">
212 <primary sortas="b-chage">chage</primary>
213 </indexterm>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry id="chfn">
218 <term><command>chfn</command></term>
219 <listitem>
220 <para>Used to change a user's full name and other information</para>
221 <indexterm zone="ch-system-shadow chfn">
222 <primary sortas="b-chfn">chfn</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry id="chpasswd">
228 <term><command>chpasswd</command></term>
229 <listitem>
230 <para>Used to update the passwords of an entire series of user
231 accounts</para>
232 <indexterm zone="ch-system-shadow chpasswd">
233 <primary sortas="b-chpasswd">chpasswd</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="chsh">
239 <term><command>chsh</command></term>
240 <listitem>
241 <para>Used to change a user's default login shell</para>
242 <indexterm zone="ch-system-shadow chsh">
243 <primary sortas="b-chsh">chsh</primary>
244 </indexterm>
245 </listitem>
246 </varlistentry>
247
248 <varlistentry id="expiry">
249 <term><command>expiry</command></term>
250 <listitem>
251 <para>Checks and enforces the current password expiration policy</para>
252 <indexterm zone="ch-system-shadow expiry">
253 <primary sortas="b-expiry">expiry</primary>
254 </indexterm>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry id="faillog">
259 <term><command>faillog</command></term>
260 <listitem>
261 <para>Is used to examine the log of login failures, to set a maximum
262 number of failures before an account is blocked, or to reset the
263 failure count</para>
264 <indexterm zone="ch-system-shadow faillog">
265 <primary sortas="b-faillog">faillog</primary>
266 </indexterm>
267 </listitem>
268 </varlistentry>
269
270 <varlistentry id="gpasswd">
271 <term><command>gpasswd</command></term>
272 <listitem>
273 <para>Is used to add and delete members and administrators to
274 groups</para>
275 <indexterm zone="ch-system-shadow gpasswd">
276 <primary sortas="b-gpasswd">gpasswd</primary>
277 </indexterm>
278 </listitem>
279 </varlistentry>
280
281 <varlistentry id="groupadd">
282 <term><command>groupadd</command></term>
283 <listitem>
284 <para>Creates a group with the given name</para>
285 <indexterm zone="ch-system-shadow groupadd">
286 <primary sortas="b-groupadd">groupadd</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="groupdel">
292 <term><command>groupdel</command></term>
293 <listitem>
294 <para>Deletes the group with the given name</para>
295 <indexterm zone="ch-system-shadow groupdel">
296 <primary sortas="b-groupdel">groupdel</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="groupmod">
302 <term><command>groupmod</command></term>
303 <listitem>
304 <para>Is used to modify the given group's name or GID</para>
305 <indexterm zone="ch-system-shadow groupmod">
306 <primary sortas="b-groupmod">groupmod</primary>
307 </indexterm>
308 </listitem>
309 </varlistentry>
310
311 <varlistentry id="grpck">
312 <term><command>grpck</command></term>
313 <listitem>
314 <para>Verifies the integrity of the group files
315 <filename>/etc/group</filename> and
316 <filename>/etc/gshadow</filename></para>
317 <indexterm zone="ch-system-shadow grpck">
318 <primary sortas="b-grpck">grpck</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="grpconv">
324 <term><command>grpconv</command></term>
325 <listitem>
326 <para>Creates or updates the shadow group file from the normal
327 group file</para>
328 <indexterm zone="ch-system-shadow grpconv">
329 <primary sortas="b-grpconv">grpconv</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="grpunconv">
335 <term><command>grpunconv</command></term>
336 <listitem>
337 <para>Updates <filename>/etc/group</filename> from
338 <filename>/etc/gshadow</filename> and then deletes the latter</para>
339 <indexterm zone="ch-system-shadow grpunconv">
340 <primary sortas="b-grpunconv">grpunconv</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="lastlog">
346 <term><command>lastlog</command></term>
347 <listitem>
348 <para>Reports the most recent login of all users or of a
349 given user</para>
350 <indexterm zone="ch-system-shadow lastlog">
351 <primary sortas="b-lastlog">lastlog</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
356 <varlistentry id="login">
357 <term><command>login</command></term>
358 <listitem>
359 <para>Is used by the system to let users sign on</para>
360 <indexterm zone="ch-system-shadow login">
361 <primary sortas="b-login">login</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="logoutd">
367 <term><command>logoutd</command></term>
368 <listitem>
369 <para>Is a daemon used to enforce restrictions on log-on time
370 and ports</para>
371 <indexterm zone="ch-system-shadow logoutd">
372 <primary sortas="b-logoutd">logoutd</primary>
373 </indexterm>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry id="newgrp">
378 <term><command>newgrp</command></term>
379 <listitem>
380 <para>Is used to change the current GID during a login session</para>
381 <indexterm zone="ch-system-shadow newgrp">
382 <primary sortas="b-newgrp">newgrp</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="newusers">
388 <term><command>newusers</command></term>
389 <listitem>
390 <para>Is used to create or update an entire series of user
391 accounts</para>
392 <indexterm zone="ch-system-shadow newusers">
393 <primary sortas="b-newusers">newusers</primary>
394 </indexterm>
395 </listitem>
396 </varlistentry>
397
398 <varlistentry id="passwd">
399 <term><command>passwd</command></term>
400 <listitem>
401 <para>Is used to change the password for a user or group account</para>
402 <indexterm zone="ch-system-shadow passwd">
403 <primary sortas="b-passwd">passwd</primary>
404 </indexterm>
405 </listitem>
406 </varlistentry>
407
408 <varlistentry id="pwck">
409 <term><command>pwck</command></term>
410 <listitem>
411 <para>Verifies the integrity of the password files
412 <filename>/etc/passwd</filename> and
413 <filename>/etc/shadow</filename></para>
414 <indexterm zone="ch-system-shadow pwck">
415 <primary sortas="b-pwck">pwck</primary>
416 </indexterm>
417 </listitem>
418 </varlistentry>
419
420 <varlistentry id="pwconv">
421 <term><command>pwconv</command></term>
422 <listitem>
423 <para>Creates or updates the shadow password file from the normal
424 password file</para>
425 <indexterm zone="ch-system-shadow pwconv">
426 <primary sortas="b-pwconv">pwconv</primary>
427 </indexterm>
428 </listitem>
429 </varlistentry>
430
431 <varlistentry id="pwunconv">
432 <term><command>pwunconv</command></term>
433 <listitem>
434 <para>Updates <filename>/etc/passwd</filename> from
435 <filename>/etc/shadow</filename> and then deletes the latter</para>
436 <indexterm zone="ch-system-shadow pwunconv">
437 <primary sortas="b-pwunconv">pwunconv</primary>
438 </indexterm>
439 </listitem>
440 </varlistentry>
441
442 <varlistentry id="sg">
443 <term><command>sg</command></term>
444 <listitem>
445 <para>Executes a given command while the user's GID
446 is set to that of the given group</para>
447 <indexterm zone="ch-system-shadow sg">
448 <primary sortas="b-sg">sg</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="su">
454 <term><command>su</command></term>
455 <listitem>
456 <para>Runs a shell with substitute user and group IDs</para>
457 <indexterm zone="ch-system-shadow su">
458 <primary sortas="b-su">su</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463 <varlistentry id="useradd">
464 <term><command>useradd</command></term>
465 <listitem>
466 <para>Creates a new user with the given name, or updates the default
467 new-user information</para>
468 <indexterm zone="ch-system-shadow useradd">
469 <primary sortas="b-useradd">useradd</primary>
470 </indexterm>
471 </listitem>
472 </varlistentry>
473
474 <varlistentry id="userdel">
475 <term><command>userdel</command></term>
476 <listitem>
477 <para>Deletes the given user account</para>
478 <indexterm zone="ch-system-shadow userdel">
479 <primary sortas="b-userdel">userdel</primary>
480 </indexterm>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry id="usermod">
485 <term><command>usermod</command></term>
486 <listitem>
487 <para>Is used to modify the given user's login name, User
488 Identification (UID), shell, initial group, home directory, etc.</para>
489 <indexterm zone="ch-system-shadow usermod">
490 <primary sortas="b-usermod">usermod</primary>
491 </indexterm>
492 </listitem>
493 </varlistentry>
494
495 <varlistentry id="vigr">
496 <term><command>vigr</command></term>
497 <listitem>
498 <para>Edits the <filename>/etc/group</filename> or
499 <filename>/etc/gshadow</filename> files</para>
500 <indexterm zone="ch-system-shadow vigr">
501 <primary sortas="b-vigr">vigr</primary>
502 </indexterm>
503 </listitem>
504 </varlistentry>
505
506 <varlistentry id="vipw">
507 <term><command>vipw</command></term>
508 <listitem>
509 <para>Edits the <filename>/etc/passwd</filename> or
510 <filename>/etc/shadow</filename> files</para>
511 <indexterm zone="ch-system-shadow vipw">
512 <primary sortas="b-vipw">vipw</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="libshadow">
518 <term><filename class="libraryfile">libshadow</filename></term>
519 <listitem>
520 <para>Contains functions used by most programs in this package</para>
521 <indexterm zone="ch-system-shadow libshadow">
522 <primary sortas="c-libshadow">libshadow</primary>
523 </indexterm>
524 </listitem>
525 </varlistentry>
526
527 </variablelist>
528
529 </sect2>
530
531</sect1>
Note: See TracBrowser for help on using the repository browser.