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

systemd
Last change on this file since dd1db761 was 7cd7f99, checked in by Chris Staub <chris@…>, 9 years ago

Put one configure option per line

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