changingowner.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-changingowner">
  7. <title>Changing Ownership</title>
  8. <?dbhtml filename="changingowner.html"?>
  9. <para>Currently, the <filename class="directory">/tools</filename>
  10. directory is owned by the user <emphasis>lfs</emphasis>, a user that
  11. exists only on the host system. Although the <filename
  12. class="directory">/tools</filename> directory can be deleted once the
  13. LFS system has been finished, it can be retained to build additional
  14. LFS systems. If the <filename class="directory">/tools</filename>
  15. directory is kept as is, the files are owned by a user ID without a
  16. corresponding account. This is dangerous because a user account
  17. created later could get this same user ID and would own the <filename
  18. class="directory">/tools</filename> directory and all the files
  19. therein, thus exposing these files to possible malicious
  20. manipulation.</para>
  21. <para>To avoid this issue, add the <emphasis>lfs</emphasis> user to
  22. the new LFS system later when creating the
  23. <filename>/etc/passwd</filename> file, taking care to assign it the
  24. same user and group IDs as on the host system. Alternatively, assign
  25. the contents of the <filename class="directory">/tools</filename>
  26. directory to user <emphasis>root</emphasis> by running the following
  27. command:</para>
  28. <screen><userinput>chown -R 0:0 /tools</userinput></screen>
  29. <para>The command uses <parameter>0:0</parameter> instead of
  30. <parameter>root:root</parameter>, because <command>chown</command>
  31. is unable to resolve the name <quote>root</quote> until the
  32. <filename>passwd</filename> file has been created.</para>
  33. </sect1>