shadowpwd-inst.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <para><screen><userinput>touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
  14. chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}</userinput></screen></para>
  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 wrongly 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 weird errors about not
  27. finding <filename>/bin/passwd</filename>. To work around this bug, create a
  28. dummy <filename>passwd</filename> file, so that it gets hard-wired
  29. properly:</para>
  30. <para><screen><userinput>touch /usr/bin/passwd</userinput></screen></para>
  31. <para>The current shadow suite has a problem in the newgrp command which causes
  32. it to fail. The following patch (also appearing in Shadow's CVS code) fixes
  33. this problem.</para>
  34. <para><screen><userinput>patch -Np1 -i ../shadow-&shadow-patch-version;.patch
  35. </userinput></screen></para>
  36. <para>Now prepare Shadow for compilation:</para>
  37. <para><screen><userinput>./configure --prefix=/usr --libdir=/usr/lib --enable-shared</userinput></screen></para>
  38. <para>Compile the package:</para>
  39. <para><screen><userinput>make</userinput></screen></para>
  40. <para>And install it:</para>
  41. <para><screen><userinput>make install</userinput></screen></para>
  42. <para>Shadow uses two files to configure authentication settings for the
  43. system. Install these two config files:</para>
  44. <para><screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen></para>
  45. <para>We want to change the password method to enable MD5 passwords which are
  46. theoretically more secure than the default "crypt" method and also allow
  47. password lengths greater than 8 characters. We also need to change the old
  48. <filename class="directory">/var/spool/mail</filename> location for user
  49. mailboxes to the current location at
  50. <filename class="directory">/var/mail</filename>. We do this by changing the
  51. relevant configuration file while copying it to its destination:</para>
  52. <para><screen><userinput>sed -e 's%/var/spool/mail%/var/mail%' \
  53. &nbsp;&nbsp;&nbsp;&nbsp;-e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
  54. &nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen></para>
  55. <note><para>Be extra careful when typing all of the above. It is probably safer
  56. to cut-and-paste it rather than try and type it all in.</para></note>
  57. <para>According to the man page of <userinput>vipw</userinput>, a
  58. <userinput>vigr</userinput> program should exist too. Since the installation
  59. procedure doesn't create this program, create a symlink manually:</para>
  60. <para><screen><userinput>ln -s vipw /usr/sbin/vigr</userinput></screen></para>
  61. <para>As the <filename>/bin/vipw</filename> symlink is redundant (and even
  62. pointing to a non-existent file), remove it:</para>
  63. <para><screen><userinput>rm /bin/vipw</userinput></screen></para>
  64. <para>Now move the <userinput>sg</userinput> program to its proper place:</para>
  65. <para><screen><userinput>mv /bin/sg /usr/bin</userinput></screen></para>
  66. <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
  67. <para><screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen></para>
  68. <para>As some packages expect to find the just-moved libraries in
  69. <filename>/usr/lib</filename>, create the following symlinks:</para>
  70. <para><screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
  71. ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen></para>
  72. <para>Coreutils has already installed a <userinput>groups</userinput> program
  73. in <filename>/usr/bin</filename>. If you wish, you can remove the one
  74. installed by Shadow:</para>
  75. <para><screen><userinput>rm /bin/groups</userinput></screen></para>
  76. </sect2>