2002-01-23 18:24:44 +00:00
|
|
|
<sect1 id="ch06-changingowner">
|
2002-06-03 12:27:19 +01:00
|
|
|
<title>Changing ownership</title>
|
2002-01-23 18:24:44 +00:00
|
|
|
<?dbhtml filename="changingowner.html" dir="chapter06"?>
|
|
|
|
|
2003-09-02 23:03:51 +01:00
|
|
|
<para>Right now the <filename class="directory">/tools</filename> directory
|
2003-05-13 08:31:22 +01:00
|
|
|
is owned by the user <emphasis>lfs</emphasis>, a user that exists only on your
|
|
|
|
host system. Although you will probably want to delete the
|
2003-09-02 23:03:51 +01:00
|
|
|
<filename class="directory">/tools</filename> directory once you have
|
2003-05-13 08:31:22 +01:00
|
|
|
finished your LFS system, you may want to keep it around, for example to
|
|
|
|
build more LFS systems. But if you keep the
|
2003-09-02 23:03:51 +01:00
|
|
|
<filename class="directory">/tools</filename> directory as it is, you end up
|
2003-05-13 08:31:22 +01:00
|
|
|
with files owned by a user ID without a corresponding account. This is
|
|
|
|
dangerous because a user account created later on could get this same user ID
|
2003-09-02 23:03:51 +01:00
|
|
|
and would suddenly own the <filename class="directory">/tools</filename>
|
2003-05-13 08:31:22 +01:00
|
|
|
directory and all the files therein, thus exposing these files to possible
|
|
|
|
malicious manipulation.</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
2003-05-13 08:31:22 +01:00
|
|
|
<para>To avoid this issue, you could add the <emphasis>lfs</emphasis> user to
|
|
|
|
your new LFS system later on when creating the <filename>/etc/passwd</filename>
|
|
|
|
file, taking care to assign it the same user and group IDs as on your host
|
|
|
|
system. Alternatively, you can (and the book assumes you do) assign the
|
2003-09-02 23:03:51 +01:00
|
|
|
contents of the <filename class="directory">/tools</filename> directory to
|
2003-05-13 08:31:22 +01:00
|
|
|
user <emphasis>root</emphasis> by running the following command:</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
2003-09-02 23:03:51 +01:00
|
|
|
<para><screen><userinput>chown -R 0:0 /tools</userinput></screen></para>
|
2002-09-08 22:54:14 +01:00
|
|
|
|
2002-10-18 19:08:39 +01:00
|
|
|
<para>The command uses "0:0" instead of "root:root", because chown is unable
|
2003-09-11 21:27:27 +01:00
|
|
|
to resolve the name "root" until the password file has been created.</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|