shadow.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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-shadow-down;
  9. &aa-shadow-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 <command>passwd</command> binary within
  14. the binary itself, but does this the wrong way. If a <command>passwd</command>
  15. binary is not present before installing Shadow, the package incorrectly assumes
  16. it is going to be located at <filename>/bin/passwd</filename>, but then
  17. installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
  18. about not finding <filename>/bin/passwd</filename>. To work around this bug,
  19. create a dummy <filename>passwd</filename> file, so that it gets hard-wired
  20. 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' &gt;&gt; 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>Instead of using the default <emphasis>crypt</emphasis> method, we want
  35. to use the more secure <emphasis>MD5</emphasis> method of password encryption,
  36. which in addition allows passwords longer than 8 characters. We also need to
  37. change the obsolete <filename class="directory">/var/spool/mail</filename>
  38. location for user mailboxes that Shadow uses by default to the <filename
  39. class="directory">/var/mail</filename> location used nowadays. We accomplish
  40. both these things by changing the relevant configuration file while copying it
  41. to its destination (it's probably better to cut-and-paste this rather than try
  42. and type it all in):</para>
  43. <screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
  44. &nbsp;&nbsp;&nbsp;&nbsp;-e 's%/var/spool/mail%/var/mail%' \
  45. &nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
  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 <command>groups</command>
  59. program in <filename class="directory">/usr/bin</filename>. Remove the one
  60. installed by Shadow:</para>
  61. <screen><userinput>rm /bin/groups</userinput></screen>
  62. </sect2>
  63. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  64. <sect2><title>Configuring Shadow</title>
  65. <para>This package contains utilities to add, modify and delete users and
  66. groups, set and change their passwords, and other such administrative tasks.
  67. For a full explanation of what <emphasis>password shadowing</emphasis> means,
  68. see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
  69. There's one thing to keep in mind if you decide to use Shadow support: programs
  70. that need to verify passwords (display managers, ftp programs, pop3 daemons,
  71. and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
  72. need to be able to work with shadowed passwords.</para>
  73. <para>To enable shadowed passwords, run the following command:</para>
  74. <screen><userinput>pwconv</userinput></screen>
  75. <para>And to enable shadowed group passwords, run:</para>
  76. <screen><userinput>grpconv</userinput></screen>
  77. <para>Under normal circumstances, you won't have created any passwords yet.
  78. However, if returning to this section later to enable shadowing, you should
  79. reset any current user passwords with the <command>passwd</command> command or
  80. any group passwords with the <command>gpasswd</command> command.</para>
  81. </sect2>
  82. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  83. <sect2>
  84. <title>Setting the root password</title>
  85. <para>Choose a password for user root and set it via:</para>
  86. <screen><userinput>passwd root</userinput></screen>
  87. </sect2>
  88. &aa-shadow-shortdesc;
  89. &aa-shadow-desc;
  90. </sect1>