Subversion Repositories svn LFS-FR

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
 <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-final-preps-addinguser">
  <?dbhtml filename="addinguser.html"?>

  <title>Adding the CLFS User</title>

  <para>When logged in as user <systemitem class="username">root</systemitem>,
  making a single mistake can damage or destroy a system. Therefore, we
  recommend building the packages as an unprivileged user.
  You could use your own user name, but to make it easier to set up a clean
  work environment, create a new user called <systemitem
 class="username">clfs</systemitem> as a member of a new group (also named
  <systemitem class="groupname">clfs</systemitem>) and use this user during
  the installation process. As <systemitem class="username">root</systemitem>,
  issue the following commands to add the new user:</para>

<screen><userinput>groupadd clfs
useradd -s /bin/bash -g clfs -d /home/clfs clfs
mkdir -pv /home/clfs
chown -v clfs:clfs /home/clfs</userinput></screen>

  <variablelist>
    <title>The meaning of the command line options:</title>

    <varlistentry>
      <term><parameter>-s /bin/bash</parameter></term>
      <listitem>
        <para>This makes <command>bash</command> the default shell for
        user <systemitem class="username">clfs</systemitem>.</para>
      </listitem>
    </varlistentry>

    <varlistentry>
      <term><parameter>-g clfs</parameter></term>
      <listitem>
        <para>This option adds user <systemitem class="username">clfs</systemitem>
        to group <systemitem class="groupname">clfs</systemitem>.</para>
      </listitem>
    </varlistentry>

    <varlistentry>
      <term><parameter>clfs</parameter></term>
      <listitem>
        <para>This is the actual name for the created group and user.</para>
      </listitem>
    </varlistentry>

  </variablelist>

  <para>To log in as <systemitem class="username">clfs</systemitem> (as
  opposed to switching to user <systemitem class="username">clfs</systemitem>
  when logged in as <systemitem class="username">root</systemitem>, which
  does not require the <systemitem class="username">clfs</systemitem> user
  to have a password), give <systemitem class="username">clfs</systemitem>
  a password:</para>

<screen><userinput>passwd clfs</userinput></screen>

  <para>Grant <systemitem class="username">clfs</systemitem> full access to
  <filename class="directory">${CLFS}</filename> by making <systemitem
 class="username">clfs</systemitem> the directory's owner:</para>

<screen><userinput>chown -Rv clfs ${CLFS}</userinput></screen>

  <para>Next, login as user <systemitem class="username">clfs</systemitem>.
  This can be done via a virtual console, through a display manager, or
  with the following substitute user command:</para>

<screen><userinput>su - clfs</userinput></screen>

  <para>The <quote><parameter>-</parameter></quote> instructs
  <command>su</command> to start a login shell as opposed to a non-login
  shell. The difference between these two types of shells can be found
  in detail in <filename>bash(1)</filename> and <command>info
  bash</command>.</para>

</sect1>