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