changingowner.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/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>Right now the <filename class="directory">/tools</filename> directory
  10. is owned by the user <emphasis>lfs</emphasis>, a user that exists only on your
  11. host system. Although you will probably want to delete the
  12. <filename class="directory">/tools</filename> directory once you have
  13. finished your LFS system, you may want to keep it around, for example to
  14. build more LFS systems. But if you keep the
  15. <filename class="directory">/tools</filename> directory as it is, you end up
  16. with files owned by a user ID without a corresponding account. This is
  17. dangerous because a user account created later on could get this same user ID
  18. and would suddenly own the <filename class="directory">/tools</filename>
  19. directory and all the files therein, thus exposing these files to possible
  20. malicious manipulation.</para>
  21. <para>To avoid this issue, you could add the <emphasis>lfs</emphasis> user to
  22. your new LFS system later on when creating the <filename>/etc/passwd</filename>
  23. file, taking care to assign it the same user and group IDs as on your host
  24. system. Alternatively, you can (and the book assumes you do) assign the
  25. contents of the <filename class="directory">/tools</filename> directory to
  26. user <emphasis>root</emphasis> by running the following command:</para>
  27. <screen><userinput>chown -R 0:0 /tools</userinput></screen>
  28. <para>The command uses <parameter>0:0</parameter> instead of <parameter>root:root</parameter>,
  29. because <userinput>chown</userinput> is unable to resolve the name
  30. <quote>root</quote> until the password file has been created.</para>
  31. </sect1>