shadowpwd.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <sect1 id="ch-system-shadow" xreflabel="Shadow">
  2. <title>Installing Shadow-&shadow-version;</title>
  3. <?dbhtml filename="shadow.html" dir="chapter06"?>
  4. <para>The Shadow package contains programs for handling passwords in a secure
  5. way.</para>
  6. <screen>&buildtime; &shadow-time;
  7. &diskspace; &shadow-compsize;</screen>
  8. &aa-shadowpwd-down;
  9. &aa-shadowpwd-dep;
  10. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  11. <sect2>
  12. <title>Installation of Shadow</title>
  13. <para>Shadow hard-wires the path to the <userinput>passwd</userinput> binary
  14. within the binary itself, but does this the wrong way. If a
  15. <userinput>passwd</userinput> binary is not present before installing Shadow,
  16. the package incorrectly assumes it is going to be located at
  17. <filename>/bin/passwd</filename>, but then installs it in
  18. <filename>/usr/bin/passwd</filename>. This will lead to errors about not finding
  19. <filename>/bin/passwd</filename>. To work around this bug, create a dummy
  20. <filename>passwd</filename> file, so that it gets hard-wired properly:</para>
  21. <screen><userinput>touch /usr/bin/passwd</userinput></screen>
  22. <para>Now prepare Shadow for compilation:</para>
  23. <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
  24. <para>Work around a problem that prevents Shadow's internationalization from
  25. working:</para>
  26. <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen>
  27. <para>Compile the package:</para>
  28. <screen><userinput>make</userinput></screen>
  29. <para>And install it:</para>
  30. <screen><userinput>make install</userinput></screen>
  31. <para>Shadow uses two files to configure authentication settings for the
  32. system. Install these two config files:</para>
  33. <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
  34. <para>We want to change the password method to enable MD5 passwords which are
  35. theoretically more secure than the default "crypt" method and also allow
  36. password lengths greater than 8 characters. We also need to change the old
  37. <filename class="directory">/var/spool/mail</filename> location for user
  38. mailboxes to the current location at
  39. <filename class="directory">/var/mail</filename>. We do this by changing the
  40. relevant configuration file while copying it to its destination:</para>
  41. <screen><userinput>sed -e 's%/var/spool/mail%/var/mail%' \
  42. &nbsp;&nbsp;&nbsp;&nbsp;-e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
  43. &nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
  44. <note><para>Be extra careful when typing all of the above. It is probably safer
  45. to cut-and-paste it rather than try and type it all in.</para></note>
  46. <para>Move some misplaced symlinks to their proper locations:</para>
  47. <screen><userinput>mv /bin/sg /usr/bin
  48. mv /bin/vigr /usr/sbin</userinput></screen>
  49. <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
  50. <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
  51. <para>As some packages expect to find the just-moved libraries in
  52. <filename>/usr/lib</filename>, create the following symlinks:</para>
  53. <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
  54. ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
  55. <para>The -D option of the <filename>useradd</filename> program requires this
  56. directory for it to work properly:</para>
  57. <screen><userinput>mkdir /etc/default</userinput></screen>
  58. <para>Coreutils has already installed a better <userinput>groups</userinput>
  59. program in <filename>/usr/bin</filename>. Remove the one installed by
  60. Shadow:</para>
  61. <screen><userinput>rm /bin/groups</userinput></screen>
  62. </sect2>
  63. &c6-cf-shadowpwd;
  64. &c6-cf-password;
  65. &aa-shadowpwd-shortdesc;
  66. &aa-shadowpwd-desc;
  67. </sect1>