changingowner.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-tools-changingowner">
  8. <?dbhtml filename="changingowner.html"?>
  9. <title>Changing Ownership</title>
  10. <note>
  11. <para>The commands in the remainder of this book must be performed while
  12. logged in as user <systemitem class="username">root</systemitem> and no
  13. longer as user <systemitem class="username">lfs</systemitem>. Also, double
  14. check that <envar>$LFS</envar> is set in <systemitem
  15. class="username">root</systemitem>'s environment.</para>
  16. </note>
  17. <para>Currently, the <filename class="directory">$LFS/tools</filename> directory
  18. is owned by the user <systemitem class="username">lfs</systemitem>, a user
  19. that exists only on the host system. If the <filename
  20. class="directory">$LFS/tools</filename> directory is kept as is, the files are
  21. owned by a user ID without a corresponding account. This is dangerous because
  22. a user account created later could get this same user ID and would own the
  23. <filename class="directory">$LFS/tools</filename> directory and all the files
  24. therein, thus exposing these files to possible malicious manipulation.</para>
  25. <para>To avoid this issue, you could add the <systemitem
  26. class="username">lfs</systemitem> user to the new LFS system later when
  27. creating the <filename>/etc/passwd</filename> file, taking care to assign it
  28. the same user and group IDs as on the host system. Better yet, change the
  29. ownership of the <filename class="directory">$LFS/tools</filename> directory to
  30. user <systemitem class="username">root</systemitem> by running the following
  31. command:</para>
  32. <screen><userinput>chown -R root:root $LFS/tools</userinput></screen>
  33. <para>Although the <filename class="directory">$LFS/tools</filename> directory
  34. can be deleted once the LFS system has been finished, it can be retained to build
  35. additional LFS systems <emphasis>of the same book version</emphasis>. How best
  36. to backup <filename class="directory">$LFS/tools</filename> is a matter of
  37. personal preference.</para>
  38. <caution>
  39. <para>If you intend to keep the temporary tools for use in building future LFS
  40. systems, <emphasis>now</emphasis> is the time to back them up. Subsequent
  41. commands in chapter 6 will alter the tools currently in place, rendering them
  42. useless for future builds.</para>
  43. </caution>
  44. </sect1>