shadowpwd-inst.xml 4.8 KB

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