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-05-02 19:20:20 +01:00
|
|
|
<para>Right now the /stage1 directory is owned by the lfs user. However,
|
2002-10-18 19:08:39 +01:00
|
|
|
this user account exists only on the host system. Although you may delete
|
2003-05-02 19:20:20 +01:00
|
|
|
the <filename class="directory">/stage1</filename> directory once you have
|
2002-10-18 19:08:39 +01:00
|
|
|
finished your LFS system, you might want to keep it around, e.g. for
|
|
|
|
building more LFS systems. But if you keep the
|
2003-05-02 19:20:20 +01:00
|
|
|
<filename class="directory">/stage1</filename> directory you will end up
|
2002-10-18 19:08:39 +01:00
|
|
|
with files owned by a user id without a corresponding account. This is
|
|
|
|
dangerous because a user account created later could get this user id and
|
2003-05-02 19:20:20 +01:00
|
|
|
would suddenly own the <filename class="directory">/stage1</filename>
|
2002-10-18 19:08:39 +01:00
|
|
|
directory and all of the files therein. This could open the
|
2003-05-02 19:20:20 +01:00
|
|
|
<filename class="directory">/stage1</filename> directory to manipulation by
|
2002-10-18 19:08:39 +01:00
|
|
|
an untrusted user.</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
2002-10-18 19:08:39 +01:00
|
|
|
<para>To avoid this issue, you can add the
|
|
|
|
<emphasis>lfs</emphasis> user to the new LFS system later when creating
|
|
|
|
the <filename>/etc/passwd</filename> file, taking care to assign it the
|
|
|
|
same user and group id. Alternatively, you can (and the book will assume
|
|
|
|
you do) run the following command now, to assign the contents of the
|
2003-05-02 19:20:20 +01:00
|
|
|
<filename class="directory">/stage1</filename> directory to user
|
2002-10-18 19:08:39 +01:00
|
|
|
<emphasis>root</emphasis> by running the following command:</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para><screen><userinput>chown -R 0:0 /stage1</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
|
|
|
|
to resolve the name "root" until glibc has been installed.</para>
|
2002-01-23 18:24:44 +00:00
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|