changingowner.xml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  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>改变文件所有者</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. <para>本书中剩余部分的命令都必须用
  17. <systemitem class="username">root</systemitem> 用户身份执行,
  18. 而不是 <systemitem class="username">lfs</systemitem> 用户。
  19. 另外,记得再次检查 <envar>$LFS</envar> 在
  20. <systemitem class="username">root</systemitem> 的环境中被正确设定。
  21. </para>
  22. </note>
  23. <!--para>Currently, the <filename class="directory">$LFS/tools</filename> directory
  24. is owned by the user <systemitem class="username">lfs</systemitem>, a user
  25. that exists only on the host system. If the <filename
  26. class="directory">$LFS/tools</filename> directory is kept as is, the files are
  27. owned by a user ID without a corresponding account. This is dangerous because
  28. a user account created later could get this same user ID and would own the
  29. <filename class="directory">$LFS/tools</filename> directory and all the files
  30. therein, thus exposing these files to possible malicious manipulation.</para-->
  31. <para>目前,<filename class="directory">$LFS/tools</filename>
  32. 目录的所有者是 <systemitem class="username">lfs</systemitem>,
  33. 这是一个仅在宿主系统上存在的用户。如果将它这样保留下去,
  34. 其中的文件将属于一个没有用户名的用户 ID。这是很危险的,
  35. 因为未来创建的一个用户名可能得到相同的用户 ID,
  36. 并获得 <filename class="directory">$LFS/tools</filename>
  37. 目录及其中文件的所有权,就有可能恶意操作它们。</para>
  38. <!--para>To avoid this issue, you could add the <systemitem
  39. class="username">lfs</systemitem> user to the new LFS system later when
  40. creating the <filename>/etc/passwd</filename> file, taking care to assign it
  41. the same user and group IDs as on the host system. Better yet, change the
  42. ownership of the <filename class="directory">$LFS/tools</filename> directory to
  43. user <systemitem class="username">root</systemitem> by running the following
  44. command:</para-->
  45. <para>为了避免这个问题,您可以在后面创建 <filename>/etc/passwd</filename>
  46. 时将 <systemitem class="username">lfs</systemitem>
  47. 用户添加到新的 LFS 系统中,注意为它分配和宿主系统一样的用户
  48. ID 和组 ID。更好的方式是,现在就把
  49. <filename class="directory">$LFS/tools</filename> 目录的所有者改变为
  50. <systemitem class="username">root</systemitem>。执行命令:</para>
  51. <screen><userinput>chown -R root:root $LFS/tools</userinput></screen>
  52. <!--para>Although the <filename class="directory">$LFS/tools</filename> directory
  53. can be deleted once the LFS system has been finished, it can be retained to build
  54. additional LFS systems <emphasis>of the same book version</emphasis>. How best
  55. to backup <filename class="directory">$LFS/tools</filename> is a matter of
  56. personal preference.</para-->
  57. <para>尽管 <filename class="directory">$LFS/tools</filename>
  58. 目录可以在 LFS 系统构建完成后删除,
  59. 但也可以保留它用于构建更多的<emphasis>相同版本的</emphasis>
  60. LFS 系统。用什么方法备份
  61. <filename class="directory">$LFS/tools</filename> 取决于个人。
  62. </para>
  63. <caution>
  64. <!--para>If you intend to keep the temporary tools for use in building future LFS
  65. systems, <emphasis>now</emphasis> is the time to back them up. Subsequent
  66. commands in chapter 6 will alter the tools currently in place, rendering them
  67. useless for future builds.</para-->
  68. <para>如果您有意保留临时工具,用来构建新的 LFS 系统,
  69. <emphasis>现在</emphasis>就要保存好它们。
  70. 第 6 章中后续执行的命令将就地调整这些工具,
  71. 导致它们不能用于构建新系统。</para>
  72. </caution>
  73. </sect1>