addinguser.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-tools-addinguser">
  7. <title>Adding the user lfs</title>
  8. <?dbhtml filename="addinguser.html"?>
  9. <para>When logged in as <emphasis>root</emphasis>, making a single mistake
  10. can damage or even wreck your system. Therefore we recommend that you
  11. build the packages in this chapter as an unprivileged user. You could
  12. of course use your own user name, but to make it easier to set up a clean
  13. work environment we'll create a new user <emphasis>lfs</emphasis> and
  14. use this one during the installation process. As <emphasis>root</emphasis>,
  15. issue the following command to add the new user:</para>
  16. <screen><userinput>useradd -s /bin/bash -m -k /dev/null lfs</userinput></screen>
  17. <para>The meaning of the switches:</para>
  18. <variablelist>
  19. <varlistentry>
  20. <term><parameter>-s /bin/bash</parameter></term>
  21. <listitem><para>This makes
  22. <command>bash</command> the default shell for user
  23. <emphasis>lfs</emphasis>.</para></listitem>
  24. </varlistentry>
  25. <varlistentry>
  26. <term><parameter>-m</parameter></term>
  27. <listitem><para>This creates a home
  28. directory for <emphasis>lfs</emphasis>.</para></listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>-k /dev/null</parameter></term>
  32. <listitem><para>This parameter
  33. prevents possible copying of files from a skeleton directory (default
  34. is <filename class="directory">/etc/skel</filename>) by changing the input location to
  35. the special null device.</para></listitem>
  36. </varlistentry>
  37. </variablelist>
  38. <para>If you want to be able to log in as <emphasis>lfs</emphasis>, then give
  39. <emphasis>lfs</emphasis> a password:</para>
  40. <screen><userinput>passwd lfs</userinput></screen>
  41. <para>and grant <emphasis>lfs</emphasis> full access to
  42. <filename class="directory">$LFS/tools</filename> by making
  43. <emphasis>lfs</emphasis> the directory owner:</para>
  44. <screen><userinput>chown lfs $LFS/tools</userinput></screen>
  45. <para>If you made a separate working directory as suggested, give user
  46. <emphasis>lfs</emphasis> ownership of this directory too:</para>
  47. <screen><userinput>chown lfs $LFS/sources</userinput></screen>
  48. <para>Next, login as user <emphasis>lfs</emphasis>. This can be done via a
  49. virtual console, through a display manager, or with the following substitute
  50. user command:</para>
  51. <screen><userinput>su - lfs</userinput></screen>
  52. <para>The <quote><parameter>-</parameter></quote> instructs <command>su</command> to
  53. start a <emphasis>login</emphasis> shell.</para>
  54. </sect1>