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

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since fa16dcec was 0a6ea84, checked in by Chris Staub <chris@…>, 11 years ago

use nologin from util-linux instead of shadow

  • Property mode set to 100644
File size: 17.5 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
[aa18ac0]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[3f8be484]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,
[0d4607d]30 refer to <ulink url="&cblfs-root;index.php/Cracklib"/>
[3f8be484]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
[0a6ea84]37 <para os="b">Disable the installation of the <command>groups</command> and
38 <command>nologin</command> programs and their man pages, as better versions
39 of these programs are provided by Coreutils and Util-linux:</para>
[9d47629]40
[0a6ea84]41<screen os="c"><userinput>sed -i src/Makefile.in \
42 -e 's/groups$(EXEEXT) //' -e 's/= nologin$(EXEEXT)/= /'
43find man -name Makefile.in -exec sed -i \
44 -e 's/man1\/groups\.1 //' -e 's/man8\/nologin\.8 //' '{}' \;</userinput></screen>
[9d47629]45
46 <para os="d">Prepare Shadow for compilation:</para>
[7447a2c]47
[9d47629]48<screen os="e"><userinput>./configure --sysconfdir=/etc</userinput></screen>
[7447a2c]49
[9d47629]50<para os="f">The meaning of the configure options:</para>
51
52 <variablelist os="g">
[2ae76c7c]53 <varlistentry>
54 <term><parameter>--sysconfdir=/etc</parameter></term>
55 <listitem><para>Tells Shadow to install its configuration files into
[7bca962]56 <filename class="directory">/etc</filename>, rather than
57 <filename class="directory">/usr/etc</filename>.</para></listitem>
[2ae76c7c]58 </varlistentry>
[e13155d]59
[7447a2c]60 </variablelist>
61
[3f8be484]62
[7447a2c]63 <para os="h">Compile the package:</para>
[3f8be484]64
[7447a2c]65<screen os="i"><userinput>make</userinput></screen>
[3f8be484]66
[d1631d1]67 <para os="j">This package does not come with a test suite.</para>
[3f8be484]68
[d1631d1]69 <para os="k">Install the package:</para>
[3f8be484]70
[d1631d1]71<screen os="l"><userinput>make install</userinput></screen>
72
[898e550]73 <para os="m" id="shadow-login_defs">Instead of using the default
[3f8be484]74 <emphasis>crypt</emphasis> method, use the more secure
[51129d2]75 <emphasis>SHA512</emphasis> method of password encryption, which also allows
[3f8be484]76 passwords longer than 8 characters. It is also necessary to change the
77 obsolete <filename class="directory">/var/spool/mail</filename> location
78 for user mailboxes that Shadow uses by default to the <filename
[a1fb12f]79 class="directory">/var/mail</filename> location used currently. Use the
80 following sed command to make these changes to the appropriate
81 configuration file:</para>
[3f8be484]82
[898e550]83 <indexterm os="n" zone="shadow-login_defs">
[3f8be484]84 <primary sortas="e-/etc/login.defs">/etc/login.defs</primary>
85 </indexterm>
86
[38fcb2c]87<screen os="s"><userinput>sed -i /etc/login.defs \
[51129d2]88 -e 's@#\(ENCRYPT_METHOD \).*@\1SHA512@' \
[38fcb2c]89 -e 's@/var/spool/mail@/var/mail@'</userinput></screen>
[81118fc]90
91 <note os="t">
[52704239]92 <para>If you built Shadow with Cracklib support, execute
93 this <command>sed</command> to correct the path to the Cracklib
94 dictionary:</para>
[3f8be484]95
[d67d6bd]96<screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' /etc/login.defs</userinput></screen>
[3f8be484]97 </note>
98
[d1631d1]99 <para os="u">Move a misplaced program to its proper location:</para>
[3f8be484]100
[d1631d1]101<screen os="v"><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
[3f8be484]102
103 </sect2>
104
105 <sect2 id="conf-shadow" role="configuration">
106 <title>Configuring Shadow</title>
107
108 <indexterm zone="conf-shadow">
109 <primary sortas="a-Shadow">Shadow</primary>
110 <secondary>configuring</secondary>
111 </indexterm>
112
113 <para>This package contains utilities to add, modify, and delete users and
114 groups; set and change their passwords; and perform other administrative
115 tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
116 means, see the <filename>doc/HOWTO</filename> file within the unpacked source
117 tree. If using Shadow support, keep in mind that programs which need to
118 verify passwords (display managers, FTP programs, pop3 daemons, etc.) must
119 be Shadow-compliant. That is, they need to be able to work with shadowed
120 passwords.</para>
121
122 <para>To enable shadowed passwords, run the following command:</para>
123
124<screen><userinput>pwconv</userinput></screen>
125
126 <para>To enable shadowed group passwords, run:</para>
127
[3a3e135]128<screen role="nodump"><userinput>grpconv</userinput></screen>
[3f8be484]129
[a1fb12f]130 <para>To view or change the default settings for new user accounts that
[d67d6bd]131 you create, you can edit <filename>/etc/default/useradd</filename>. See
[a1fb12f]132 <command>man useradd</command> or
[48770b9]133 <ulink url="&cblfs-root;index.php/Configuring_for_Adding_Users"/> for more
[a1fb12f]134 information.</para>
135
[3f8be484]136 </sect2>
137
138 <sect2 id="root-password" role="configuration">
139 <title>Setting the root password</title>
140
141 <para>Choose a password for user <systemitem
142 class="username">root</systemitem> and set it by running:</para>
143
[0f3854e]144<screen role="nodump"><userinput>passwd root</userinput></screen>
[3f8be484]145
146 </sect2>
147
148 <sect2 id="contents-shadow" role="content">
149 <title>Contents of Shadow</title>
150
151 <segmentedlist>
152 <segtitle>Installed programs</segtitle>
[61ad0b7f]153 <segtitle>Installed directory</segtitle>
[3f8be484]154
155 <seglistitem>
[a68b59e]156 <seg>chage, chfn, chpasswd, chgpasswd, chsh, expiry, faillog, gpasswd,
[0a11182]157 groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
[0a6ea84]158 lastlog, login, logoutd, newgrp, newusers, passwd, pwck,
[0a11182]159 pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod,
[e29fb58]160 vigr (link to vipw), and vipw</seg>
[61ad0b7f]161 <seg>/etc/default</seg>
[3f8be484]162 </seglistitem>
163 </segmentedlist>
164
165 <variablelist>
166 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
167 <?dbfo list-presentation="list"?>
168 <?dbhtml list-presentation="table"?>
169
170 <varlistentry id="chage">
171 <term><command>chage</command></term>
172 <listitem>
173 <para>Used to change the maximum number of days between obligatory
174 password changes</para>
175 <indexterm zone="ch-system-shadow chage">
176 <primary sortas="b-chage">chage</primary>
177 </indexterm>
178 </listitem>
179 </varlistentry>
180
181 <varlistentry id="chfn">
182 <term><command>chfn</command></term>
183 <listitem>
184 <para>Used to change a user's full name and other information</para>
185 <indexterm zone="ch-system-shadow chfn">
186 <primary sortas="b-chfn">chfn</primary>
187 </indexterm>
188 </listitem>
189 </varlistentry>
190
[a68b59e]191 <varlistentry id="chgpasswd">
192 <term><command>chgpasswd</command></term>
193 <listitem>
194 <para>Used to update group passwords in batch mode</para>
195 <indexterm zone="ch-system-shadow chgpasswd">
196 <primary sortas="b-chgpasswd">chgpasswd</primary>
197 </indexterm>
198 </listitem>
199 </varlistentry>
200
[3f8be484]201 <varlistentry id="chpasswd">
202 <term><command>chpasswd</command></term>
203 <listitem>
204 <para>Used to update the passwords of an entire series of user
205 accounts</para>
206 <indexterm zone="ch-system-shadow chpasswd">
207 <primary sortas="b-chpasswd">chpasswd</primary>
208 </indexterm>
209 </listitem>
210 </varlistentry>
211
212 <varlistentry id="chsh">
213 <term><command>chsh</command></term>
214 <listitem>
215 <para>Used to change a user's default login shell</para>
216 <indexterm zone="ch-system-shadow chsh">
217 <primary sortas="b-chsh">chsh</primary>
218 </indexterm>
219 </listitem>
220 </varlistentry>
221
222 <varlistentry id="expiry">
223 <term><command>expiry</command></term>
224 <listitem>
225 <para>Checks and enforces the current password expiration policy</para>
226 <indexterm zone="ch-system-shadow expiry">
227 <primary sortas="b-expiry">expiry</primary>
228 </indexterm>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry id="faillog">
233 <term><command>faillog</command></term>
234 <listitem>
235 <para>Is used to examine the log of login failures, to set a maximum
236 number of failures before an account is blocked, or to reset the
237 failure count</para>
238 <indexterm zone="ch-system-shadow faillog">
239 <primary sortas="b-faillog">faillog</primary>
240 </indexterm>
241 </listitem>
242 </varlistentry>
243
244 <varlistentry id="gpasswd">
245 <term><command>gpasswd</command></term>
246 <listitem>
247 <para>Is used to add and delete members and administrators to
248 groups</para>
249 <indexterm zone="ch-system-shadow gpasswd">
250 <primary sortas="b-gpasswd">gpasswd</primary>
251 </indexterm>
252 </listitem>
253 </varlistentry>
254
255 <varlistentry id="groupadd">
256 <term><command>groupadd</command></term>
257 <listitem>
258 <para>Creates a group with the given name</para>
259 <indexterm zone="ch-system-shadow groupadd">
260 <primary sortas="b-groupadd">groupadd</primary>
261 </indexterm>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry id="groupdel">
266 <term><command>groupdel</command></term>
267 <listitem>
268 <para>Deletes the group with the given name</para>
269 <indexterm zone="ch-system-shadow groupdel">
270 <primary sortas="b-groupdel">groupdel</primary>
271 </indexterm>
272 </listitem>
273 </varlistentry>
274
[0a11182]275 <varlistentry id="groupmems">
276 <term><command>groupmems</command></term>
277 <listitem>
278 <para>Allows a user to administer his/her own group membership list
279 without the requirement of superuser privileges</para>
280 <indexterm zone="ch-system-shadow groupmems">
281 <primary sortas="b-groupmems">groupmems</primary>
282 </indexterm>
283 </listitem>
284 </varlistentry>
285
[3f8be484]286 <varlistentry id="groupmod">
287 <term><command>groupmod</command></term>
288 <listitem>
289 <para>Is used to modify the given group's name or GID</para>
290 <indexterm zone="ch-system-shadow groupmod">
291 <primary sortas="b-groupmod">groupmod</primary>
292 </indexterm>
293 </listitem>
294 </varlistentry>
295
296 <varlistentry id="grpck">
297 <term><command>grpck</command></term>
298 <listitem>
299 <para>Verifies the integrity of the group files
300 <filename>/etc/group</filename> and
301 <filename>/etc/gshadow</filename></para>
302 <indexterm zone="ch-system-shadow grpck">
303 <primary sortas="b-grpck">grpck</primary>
304 </indexterm>
305 </listitem>
306 </varlistentry>
307
308 <varlistentry id="grpconv">
309 <term><command>grpconv</command></term>
310 <listitem>
311 <para>Creates or updates the shadow group file from the normal
312 group file</para>
313 <indexterm zone="ch-system-shadow grpconv">
314 <primary sortas="b-grpconv">grpconv</primary>
315 </indexterm>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry id="grpunconv">
320 <term><command>grpunconv</command></term>
321 <listitem>
322 <para>Updates <filename>/etc/group</filename> from
323 <filename>/etc/gshadow</filename> and then deletes the latter</para>
324 <indexterm zone="ch-system-shadow grpunconv">
325 <primary sortas="b-grpunconv">grpunconv</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="lastlog">
331 <term><command>lastlog</command></term>
332 <listitem>
333 <para>Reports the most recent login of all users or of a
334 given user</para>
335 <indexterm zone="ch-system-shadow lastlog">
336 <primary sortas="b-lastlog">lastlog</primary>
337 </indexterm>
338 </listitem>
339 </varlistentry>
340
341 <varlistentry id="login">
342 <term><command>login</command></term>
343 <listitem>
344 <para>Is used by the system to let users sign on</para>
345 <indexterm zone="ch-system-shadow login">
346 <primary sortas="b-login">login</primary>
347 </indexterm>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry id="logoutd">
352 <term><command>logoutd</command></term>
353 <listitem>
354 <para>Is a daemon used to enforce restrictions on log-on time
355 and ports</para>
356 <indexterm zone="ch-system-shadow logoutd">
357 <primary sortas="b-logoutd">logoutd</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="newgrp">
363 <term><command>newgrp</command></term>
364 <listitem>
365 <para>Is used to change the current GID during a login session</para>
366 <indexterm zone="ch-system-shadow newgrp">
367 <primary sortas="b-newgrp">newgrp</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="newusers">
373 <term><command>newusers</command></term>
374 <listitem>
375 <para>Is used to create or update an entire series of user
376 accounts</para>
377 <indexterm zone="ch-system-shadow newusers">
378 <primary sortas="b-newusers">newusers</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
383 <varlistentry id="passwd">
384 <term><command>passwd</command></term>
385 <listitem>
386 <para>Is used to change the password for a user or group account</para>
387 <indexterm zone="ch-system-shadow passwd">
388 <primary sortas="b-passwd">passwd</primary>
389 </indexterm>
390 </listitem>
391 </varlistentry>
392
393 <varlistentry id="pwck">
394 <term><command>pwck</command></term>
395 <listitem>
396 <para>Verifies the integrity of the password files
397 <filename>/etc/passwd</filename> and
398 <filename>/etc/shadow</filename></para>
399 <indexterm zone="ch-system-shadow pwck">
400 <primary sortas="b-pwck">pwck</primary>
401 </indexterm>
402 </listitem>
403 </varlistentry>
404
405 <varlistentry id="pwconv">
406 <term><command>pwconv</command></term>
407 <listitem>
408 <para>Creates or updates the shadow password file from the normal
409 password file</para>
410 <indexterm zone="ch-system-shadow pwconv">
411 <primary sortas="b-pwconv">pwconv</primary>
412 </indexterm>
413 </listitem>
414 </varlistentry>
415
416 <varlistentry id="pwunconv">
417 <term><command>pwunconv</command></term>
418 <listitem>
419 <para>Updates <filename>/etc/passwd</filename> from
420 <filename>/etc/shadow</filename> and then deletes the latter</para>
421 <indexterm zone="ch-system-shadow pwunconv">
422 <primary sortas="b-pwunconv">pwunconv</primary>
423 </indexterm>
424 </listitem>
425 </varlistentry>
426
427 <varlistentry id="sg">
428 <term><command>sg</command></term>
429 <listitem>
430 <para>Executes a given command while the user's GID
431 is set to that of the given group</para>
432 <indexterm zone="ch-system-shadow sg">
433 <primary sortas="b-sg">sg</primary>
434 </indexterm>
435 </listitem>
436 </varlistentry>
437
438 <varlistentry id="su">
439 <term><command>su</command></term>
440 <listitem>
441 <para>Runs a shell with substitute user and group IDs</para>
442 <indexterm zone="ch-system-shadow su">
443 <primary sortas="b-su">su</primary>
444 </indexterm>
445 </listitem>
446 </varlistentry>
447
448 <varlistentry id="useradd">
449 <term><command>useradd</command></term>
450 <listitem>
451 <para>Creates a new user with the given name, or updates the default
452 new-user information</para>
453 <indexterm zone="ch-system-shadow useradd">
454 <primary sortas="b-useradd">useradd</primary>
455 </indexterm>
456 </listitem>
457 </varlistentry>
458
459 <varlistentry id="userdel">
460 <term><command>userdel</command></term>
461 <listitem>
462 <para>Deletes the given user account</para>
463 <indexterm zone="ch-system-shadow userdel">
464 <primary sortas="b-userdel">userdel</primary>
465 </indexterm>
466 </listitem>
467 </varlistentry>
468
469 <varlistentry id="usermod">
470 <term><command>usermod</command></term>
471 <listitem>
472 <para>Is used to modify the given user's login name, User
473 Identification (UID), shell, initial group, home directory, etc.</para>
474 <indexterm zone="ch-system-shadow usermod">
475 <primary sortas="b-usermod">usermod</primary>
476 </indexterm>
477 </listitem>
478 </varlistentry>
479
480 <varlistentry id="vigr">
481 <term><command>vigr</command></term>
482 <listitem>
483 <para>Edits the <filename>/etc/group</filename> or
484 <filename>/etc/gshadow</filename> files</para>
485 <indexterm zone="ch-system-shadow vigr">
486 <primary sortas="b-vigr">vigr</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry>
490
491 <varlistentry id="vipw">
492 <term><command>vipw</command></term>
493 <listitem>
494 <para>Edits the <filename>/etc/passwd</filename> or
495 <filename>/etc/shadow</filename> files</para>
496 <indexterm zone="ch-system-shadow vipw">
497 <primary sortas="b-vipw">vipw</primary>
498 </indexterm>
499 </listitem>
500 </varlistentry>
501
502 </variablelist>
503
504 </sect2>
505
506</sect1>
Note: See TracBrowser for help on using the repository browser.