changingowner.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 whole directory hierarchy in <filename
  18. class="directory">$LFS</filename>
  19. is owned by the user <systemitem class="username">lfs</systemitem>, a user
  20. that exists only on the host system. If the directories under <filename
  21. class="directory">$LFS</filename> are kept as they are, the files are
  22. owned by a user ID without a corresponding account. This is dangerous because
  23. a user account created later could get this same user ID and would own all
  24. the files under <filename class="directory">$LFS</filename>, thus exposing
  25. these files to possible malicious manipulation.</para>
  26. <para>To avoid this issue, you could add the <systemitem
  27. class="username">lfs</systemitem> user to the new LFS system later when
  28. creating the <filename>/etc/passwd</filename> file, taking care to assign it
  29. the same user and group IDs as on the host system. Better yet, change the
  30. ownership of the <filename class="directory">$LFS/*</filename> directories to
  31. user <systemitem class="username">root</systemitem> by running the following
  32. command:</para>
  33. <screen><userinput>chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,lib64,tools}</userinput></screen>
  34. </sect1>