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

clfs-3.0.0-systemd systemd
Last change on this file since 92574e0 was 9d5637f5, checked in by Chris Staub <chris@…>, 10 years ago

Consolidated cracklib notes

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