adding-user.xml 1.2 KB

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