2003-01-05 16:19:00 +00:00
|
|
|
<sect1 id="ch05-addinguser">
|
|
|
|
<title>Adding the user lfs</title>
|
|
|
|
<?dbhtml filename="addinguser.html" dir="chapter05"?>
|
|
|
|
|
|
|
|
<para>If you are logged in as <emphasis>root</emphasis> during Chapter 5,
|
|
|
|
your host system can be damaged by a single mistake. We recommend that
|
|
|
|
you build the packages in Chapter 5 as an unprivileged user. You could use
|
|
|
|
your own user name, but to ensure a clean build environment, we'll create a
|
|
|
|
new user: <emphasis>lfs</emphasis>. As <emphasis>root</emphasis>, issue
|
|
|
|
the following commands to add the new user:</para>
|
|
|
|
|
|
|
|
<para><screen><userinput>useradd -s /bin/bash -m lfs
|
|
|
|
passwd lfs</userinput></screen></para>
|
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para>In order to grant ownership of the <filename>$LFS/stage1</filename>
|
2003-01-09 00:39:48 +00:00
|
|
|
directory to the user <emphasis>lfs</emphasis>, issue the command:</para>
|
2003-01-05 16:19:00 +00:00
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para><screen><userinput>chown lfs $LFS/stage1</userinput></screen></para>
|
2003-01-05 16:19:00 +00:00
|
|
|
|
|
|
|
<para>Next, login as user <emphasis>lfs</emphasis>. This can be accomplished
|
|
|
|
via a virtual console, display manager or with the substitute user
|
|
|
|
command:</para>
|
|
|
|
|
|
|
|
<para><screen><userinput>su - lfs</userinput></screen></para>
|
|
|
|
|
|
|
|
<para>The "<userinput>-</userinput>" instructs <userinput>su</userinput> to
|
|
|
|
start a new, clean shell.</para>
|
|
|
|
|
|
|
|
</sect1>
|