adding-user.xml 1.2 KB

123456789101112131415161718192021222324252627282930
  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 the user <emphasis>lfs</emphasis> the proper permissions
  13. to the <filename>$LFS/static</filename> directory, issue the following
  14. command:</para>
  15. <para><screen><userinput>chown -R lfs $LFS/static</userinput></screen></para>
  16. <para>Next, login as user <emphasis>lfs</emphasis>. This can be accomplished
  17. via a virtual console, display manager or with the substitute user
  18. command:</para>
  19. <para><screen><userinput>su - lfs</userinput></screen></para>
  20. <para>The "<userinput>-</userinput>" instructs <userinput>su</userinput> to
  21. start a new, clean shell.</para>
  22. </sect1>