1 | <sect1 id="ch-system-shadow" xreflabel="Shadow">
|
---|
2 | <title>Installing Shadow-&shadow-version;</title>
|
---|
3 | <?dbhtml filename="shadow.html" dir="chapter06"?>
|
---|
4 |
|
---|
5 | <para>The Shadow package contains programs for handling passwords in a secure
|
---|
6 | way.</para>
|
---|
7 |
|
---|
8 | <screen>&buildtime; &shadow-time;
|
---|
9 | &diskspace; &shadow-compsize;</screen>
|
---|
10 |
|
---|
11 | &aa-shadow-down;
|
---|
12 | &aa-shadow-dep;
|
---|
13 |
|
---|
14 | <sect2><title> </title><para> </para></sect2>
|
---|
15 |
|
---|
16 | <sect2>
|
---|
17 | <title>Installation of Shadow</title>
|
---|
18 |
|
---|
19 | <para>Shadow hard-wires the path to the <command>passwd</command> binary within
|
---|
20 | the binary itself, but does this the wrong way. If a <command>passwd</command>
|
---|
21 | binary is not present before installing Shadow, the package incorrectly assumes
|
---|
22 | it is going to be located at <filename>/bin/passwd</filename>, but then
|
---|
23 | installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
|
---|
24 | about not finding <filename>/bin/passwd</filename>. To work around this bug,
|
---|
25 | create a dummy <filename>passwd</filename> file, so that it gets hard-wired
|
---|
26 | properly:</para>
|
---|
27 |
|
---|
28 | <screen><userinput>touch /usr/bin/passwd</userinput></screen>
|
---|
29 |
|
---|
30 | <para>Now prepare Shadow for compilation:</para>
|
---|
31 |
|
---|
32 | <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
|
---|
33 |
|
---|
34 | <para>Work around a problem that prevents Shadow's internationalization from
|
---|
35 | working:</para>
|
---|
36 |
|
---|
37 | <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen>
|
---|
38 |
|
---|
39 | <para>Compile the package:</para>
|
---|
40 |
|
---|
41 | <screen><userinput>make</userinput></screen>
|
---|
42 |
|
---|
43 | <para>And install it:</para>
|
---|
44 |
|
---|
45 | <screen><userinput>make install</userinput></screen>
|
---|
46 |
|
---|
47 | <para>Shadow uses two files to configure authentication settings for the
|
---|
48 | system. Install these two config files:</para>
|
---|
49 |
|
---|
50 | <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
|
---|
51 |
|
---|
52 | <para>Instead of using the default <emphasis>crypt</emphasis> method, we want
|
---|
53 | to use the more secure <emphasis>MD5</emphasis> method of password encryption,
|
---|
54 | which in addition allows passwords longer than 8 characters. We also need to
|
---|
55 | change the obsolete <filename class="directory">/var/spool/mail</filename>
|
---|
56 | location for user mailboxes that Shadow uses by default to the <filename
|
---|
57 | class="directory">/var/mail</filename> location used nowadays. We accomplish
|
---|
58 | both these things by changing the relevant configuration file while copying it
|
---|
59 | to its destination (it's probably better to cut-and-paste this rather than try
|
---|
60 | and type it all in):</para>
|
---|
61 |
|
---|
62 | <screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
|
---|
63 | -e 's%/var/spool/mail%/var/mail%' \
|
---|
64 | etc/login.defs.linux > /etc/login.defs</userinput></screen>
|
---|
65 |
|
---|
66 | <para>Move some misplaced symlinks to their proper locations:</para>
|
---|
67 |
|
---|
68 | <screen><userinput>mv /bin/sg /usr/bin
|
---|
69 | mv /bin/vigr /usr/sbin</userinput></screen>
|
---|
70 |
|
---|
71 | <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
|
---|
72 |
|
---|
73 | <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
|
---|
74 |
|
---|
75 | <para>As some packages expect to find the just-moved libraries in
|
---|
76 | <filename>/usr/lib</filename>, create the following symlinks:</para>
|
---|
77 |
|
---|
78 | <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
|
---|
79 | ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
|
---|
80 |
|
---|
81 | <para>The -D option of the <filename>useradd</filename> program requires this
|
---|
82 | directory for it to work properly:</para>
|
---|
83 |
|
---|
84 | <screen><userinput>mkdir /etc/default</userinput></screen>
|
---|
85 |
|
---|
86 | <para>Coreutils has already installed a better <command>groups</command>
|
---|
87 | program in <filename class="directory">/usr/bin</filename>. Remove the one
|
---|
88 | installed by Shadow:</para>
|
---|
89 |
|
---|
90 | <screen><userinput>rm /bin/groups</userinput></screen>
|
---|
91 |
|
---|
92 | </sect2>
|
---|
93 |
|
---|
94 | <sect2><title> </title><para> </para></sect2>
|
---|
95 |
|
---|
96 | <sect2><title>Configuring Shadow</title>
|
---|
97 |
|
---|
98 | <para>This package contains utilities to add, modify and delete users and
|
---|
99 | groups, set and change their passwords, and other such administrative tasks.
|
---|
100 | For a full explanation of what <emphasis>password shadowing</emphasis> means,
|
---|
101 | see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
|
---|
102 | There's one thing to keep in mind if you decide to use Shadow support: programs
|
---|
103 | that need to verify passwords (display managers, ftp programs, pop3 daemons,
|
---|
104 | and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
|
---|
105 | need to be able to work with shadowed passwords.</para>
|
---|
106 |
|
---|
107 | <para>To enable shadowed passwords, run the following command:</para>
|
---|
108 |
|
---|
109 | <screen><userinput>pwconv</userinput></screen>
|
---|
110 |
|
---|
111 | <para>And to enable shadowed group passwords, run:</para>
|
---|
112 |
|
---|
113 | <screen><userinput>grpconv</userinput></screen>
|
---|
114 |
|
---|
115 | <para>Under normal circumstances, you won't have created any passwords yet.
|
---|
116 | However, if returning to this section later to enable shadowing, you should
|
---|
117 | reset any current user passwords with the <command>passwd</command> command or
|
---|
118 | any group passwords with the <command>gpasswd</command> command.</para>
|
---|
119 |
|
---|
120 | </sect2>
|
---|
121 |
|
---|
122 | <sect2><title> </title><para> </para></sect2>
|
---|
123 |
|
---|
124 | <sect2>
|
---|
125 | <title>Setting the root password</title>
|
---|
126 |
|
---|
127 | <para>Choose a password for user root and set it via:</para>
|
---|
128 |
|
---|
129 | <screen><userinput>passwd root</userinput></screen>
|
---|
130 |
|
---|
131 | </sect2>
|
---|
132 |
|
---|
133 | &aa-shadow-shortdesc;
|
---|
134 | &aa-shadow-desc;
|
---|
135 |
|
---|
136 | </sect1>
|
---|
137 |
|
---|