source: BOOK/boot/common/changingowner.xml @ fa6e750

Last change on this file since fa6e750 was fa6e750, checked in by Jim Gifford <clfs@…>, 17 years ago

r1034@server (orig r1032): chris | 2006-01-09 22:37:46 -0800
Changed the 'changing ownership' pages for boot and chroot because the each need different instructions

  • Property mode set to 100644
File size: 2.7 KB
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3  "" [
4  <!ENTITY % general-entities SYSTEM "../../general.ent">
5  %general-entities;
8<sect1 id="ch-boot-changingowner">
9  <?dbhtml filename="changingowner.html"?>
11  <title>Changing Ownership</title>
13  <note os="a">
14    <para>From now on, all commands in the rest of the book will be run as the <systemitem class="username">root</systemitem> user.</para>
15  </note>
17  <para os="b">Currently, the <filename class="directory">/tools</filename>
18  directory, <filename class="directory">/cross-tools</filename> directory, and
19  <filename class="directory">$LFS</filename> directory are owned
20  by the user <systemitem class="username">lfs</systemitem>,
21  a user that exists only on the host system. For security reasons, the $LFS root directory and all of it subdirectories should be owned by <systemitem class="username">root</systemitem>. Change the ownership for $LFS and its subdirectories by running these commands:</para>
23<screen><userinput>chown root:root ${LFS}
24chown -R root:root $LFS/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}</userinput></screen>
26  <para os="c">The same issue also exists with <filename class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename>. Although these directories can be deleted once the
27  LFS system has been finished, they can be retained to build additional
28  LFS systems. If the <filename class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename>
29  directories are kept as is, the files are owned by a user ID without a
30  corresponding account. This is dangerous because a user account created
31  later could get this same user ID and would own the <filename
32  class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename> directories and all the files therein,
33  thus exposing these files to possible malicious manipulation.</para>
35  <para os="d">To avoid this issue, add the <systemitem
36  class="username">lfs</systemitem> user to the new LFS system later when
37  creating the <filename>/etc/passwd</filename> file, taking care to assign
38  it the same user and group IDs as on the host system. Alternatively,
39  assign the contents of the <filename class="directory">/tools</filename>
40  and <filename class="directory">/cross-tools</filename> directories to user <systemitem class="username">root</systemitem> by running
41  the following commands:</para>
43<screen><userinput>chown -R root:root /tools
44chown -R root:root /cross-tools</userinput></screen>
46  <para os="e">This book assumes you ran these <command>chown</command> commands.</para>
Note: See TracBrowser for help on using the repository browser.