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

sysvinit
Last change on this file since 594c531 was a72db74, checked in by William Harrington <kb0iic@…>, 8 years ago

Shadow nologin should be installed and any remnants of Util-linux nologin should be removed. It is done.

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