shadowpwd-inst.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of Shadow Password Suite</title>
  4. <para>The <userinput>login</userinput>, <userinput>getty</userinput> and
  5. <userinput>init</userinput> programs (and some others) maintain a number
  6. of logfiles to record who are and who were logged in to the system. These
  7. programs, however, don't create these logfiles when they don't exist, so if
  8. you want this logging to occur you will have to create the files yourself.
  9. To let the Shadow package (that is installed next) detect these files in their
  10. proper place, create them now, with their proper permissions:</para>
  11. <para>Create these files with their proper permissions by running the
  12. following commands:</para>
  13. <screen><userinput>touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
  14. chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}</userinput></screen>
  15. <para>The <filename>/var/run/utmp</filename> file lists the users that are
  16. currently logged in, the <filename>/var/log/wtmp</filename> file who
  17. <emphasis>were</emphasis> logged in and when.
  18. The <filename>/var/log/lastlog</filename> file shows for each user when he
  19. or she last logged in, and the <filename>/var/log/btmp</filename> lists the
  20. bad login attempts.</para>
  21. <para>Shadow hard-wires the path to the <userinput>passwd</userinput> binary
  22. within the binary itself, but does this the wrong way. If a
  23. <userinput>passwd</userinput> binary is not present before installing Shadow,
  24. the package incorrectly assumes it is going to be located at
  25. <filename>/bin/passwd</filename>, but then installs it in
  26. <filename>/usr/bin/passwd</filename>. This will lead to errors about not finding
  27. <filename>/bin/passwd</filename>. To work around this bug, create a dummy
  28. <filename>passwd</filename> file, so that it gets hard-wired properly:</para>
  29. <screen><userinput>touch /usr/bin/passwd</userinput></screen>
  30. <para>The current shadow suite has a problem in the newgrp command which causes
  31. it to fail. The following patch (also appearing in Shadow's CVS code) fixes
  32. this problem.</para>
  33. <screen><userinput>patch -Np1 -i ../&shadow-patch;</userinput></screen>
  34. <para>Now prepare Shadow for compilation:</para>
  35. <screen><userinput>./configure --prefix=/usr --libdir=/usr/lib --enable-shared</userinput></screen>
  36. <para>Compile the package:</para>
  37. <screen><userinput>make</userinput></screen>
  38. <para>And install it:</para>
  39. <screen><userinput>make install</userinput></screen>
  40. <para>Shadow uses two files to configure authentication settings for the
  41. system. Install these two config files:</para>
  42. <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
  43. <para>We want to change the password method to enable MD5 passwords which are
  44. theoretically more secure than the default "crypt" method and also allow
  45. password lengths greater than 8 characters. We also need to change the old
  46. <filename class="directory">/var/spool/mail</filename> location for user
  47. mailboxes to the current location at
  48. <filename class="directory">/var/mail</filename>. We do this by changing the
  49. relevant configuration file while copying it to its destination:</para>
  50. <screen><userinput>sed -e 's%/var/spool/mail%/var/mail%' \
  51. &nbsp;&nbsp;&nbsp;&nbsp;-e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
  52. &nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
  53. <note><para>Be extra careful when typing all of the above. It is probably safer
  54. to cut-and-paste it rather than try and type it all in.</para></note>
  55. <para>According to the man page of <userinput>vipw</userinput>, a
  56. <userinput>vigr</userinput> program should exist too. Since the installation
  57. procedure doesn't create this program, create a symlink manually:</para>
  58. <screen><userinput>ln -s vipw /usr/sbin/vigr</userinput></screen>
  59. <para>As the <filename>/bin/vipw</filename> symlink is redundant (and even
  60. pointing to a non-existent file), remove it:</para>
  61. <screen><userinput>rm /bin/vipw</userinput></screen>
  62. <para>Now move the <userinput>sg</userinput> program to its proper place:</para>
  63. <screen><userinput>mv /bin/sg /usr/bin</userinput></screen>
  64. <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
  65. <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
  66. <para>As some packages expect to find the just-moved libraries in
  67. <filename>/usr/lib</filename>, create the following symlinks:</para>
  68. <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
  69. ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
  70. <para>Coreutils has already installed a <userinput>groups</userinput> program
  71. in <filename>/usr/bin</filename>. If you wish, you can remove the one
  72. installed by Shadow:</para>
  73. <screen><userinput>rm /bin/groups</userinput></screen>
  74. </sect2>