[3be4d97] | 1 | <sect1 id="ch-system-shadow" xreflabel="Shadow">
|
---|
[e1f2f4db] | 2 | <title>Installing Shadow-&shadow-version;</title>
|
---|
[576e206] | 3 | <?dbhtml filename="shadow.html" dir="chapter06"?>
|
---|
[6370fa6] | 4 |
|
---|
[5888299] | 5 | <para>The Shadow package contains programs for handling passwords in a secure
|
---|
| 6 | way.</para>
|
---|
| 7 |
|
---|
[69276a94] | 8 | <screen>&buildtime; &shadow-time;
|
---|
| 9 | &diskspace; &shadow-compsize;</screen>
|
---|
[3554fa3a] | 10 |
|
---|
[2309b72] | 11 | &aa-shadow-down;
|
---|
| 12 | &aa-shadow-dep;
|
---|
[73aedd1d] | 13 |
|
---|
| 14 | <sect2><title> </title><para> </para></sect2>
|
---|
| 15 |
|
---|
| 16 | <sect2>
|
---|
| 17 | <title>Installation of Shadow</title>
|
---|
| 18 |
|
---|
[c21999c6] | 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>
|
---|
[73aedd1d] | 27 |
|
---|
| 28 | <screen><userinput>touch /usr/bin/passwd</userinput></screen>
|
---|
| 29 |
|
---|
[d0a6c4c] | 30 | <para>Now prepare Shadow for compilation:</para>
|
---|
[73aedd1d] | 31 |
|
---|
[d0a6c4c] | 32 | <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 33 |
|
---|
[d0a6c4c] | 34 | <para>Work around a problem that prevents Shadow's internationalization from
|
---|
| 35 | working:</para>
|
---|
[73aedd1d] | 36 |
|
---|
[cd0c92d6] | 37 | <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen>
|
---|
[73aedd1d] | 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 |
|
---|
[c21999c6] | 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%' \
|
---|
[73aedd1d] | 64 | etc/login.defs.linux > /etc/login.defs</userinput></screen>
|
---|
| 65 |
|
---|
[d0a6c4c] | 66 | <para>Move some misplaced symlinks to their proper locations:</para>
|
---|
[73aedd1d] | 67 |
|
---|
[d0a6c4c] | 68 | <screen><userinput>mv /bin/sg /usr/bin
|
---|
| 69 | mv /bin/vigr /usr/sbin</userinput></screen>
|
---|
[73aedd1d] | 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 |
|
---|
[638a816e] | 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 |
|
---|
[90e3cb3] | 86 | <para>Coreutils has already installed a better <command>groups</command>
|
---|
[c21999c6] | 87 | program in <filename class="directory">/usr/bin</filename>. Remove the one
|
---|
| 88 | installed by Shadow:</para>
|
---|
[73aedd1d] | 89 |
|
---|
| 90 | <screen><userinput>rm /bin/groups</userinput></screen>
|
---|
| 91 |
|
---|
| 92 | </sect2>
|
---|
[24351aa] | 93 |
|
---|
[2309b72] | 94 | <sect2><title> </title><para> </para></sect2>
|
---|
| 95 |
|
---|
| 96 | <sect2><title>Configuring Shadow</title>
|
---|
| 97 |
|
---|
[c21999c6] | 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>
|
---|
[2309b72] | 106 |
|
---|
| 107 | <para>To enable shadowed passwords, run the following command:</para>
|
---|
| 108 |
|
---|
[cd1ddd7] | 109 | <screen><userinput>pwconv</userinput></screen>
|
---|
[2309b72] | 110 |
|
---|
[c21999c6] | 111 | <para>And to enable shadowed group passwords, run:</para>
|
---|
[2309b72] | 112 |
|
---|
[cd1ddd7] | 113 | <screen><userinput>grpconv</userinput></screen>
|
---|
[2309b72] | 114 |
|
---|
| 115 | <para>Under normal circumstances, you won't have created any passwords yet.
|
---|
[c21999c6] | 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 |
|
---|
[2309b72] | 120 | </sect2>
|
---|
| 121 |
|
---|
[c21999c6] | 122 | <sect2><title> </title><para> </para></sect2>
|
---|
| 123 |
|
---|
[2309b72] | 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>
|
---|
[24351aa] | 132 |
|
---|
[2309b72] | 133 | &aa-shadow-shortdesc;
|
---|
| 134 | &aa-shadow-desc;
|
---|
[5888299] | 135 |
|
---|
[6370fa6] | 136 | </sect1>
|
---|
[73aedd1d] | 137 |
|
---|