source: clfs-sysroot/BOOK/final-preps/addinguser.xml@ 8e6a7d4

Last change on this file since 8e6a7d4 was 76c3eca, checked in by Chris Staub <chris@…>, 16 years ago

CLFS sysroot normally uses DESTDIR anyway

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[02095ae]1<?xml version="1.0" encoding="ISO-8859-1"?>
[c439b8a]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[02095ae]4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-final-preps-addinguser">
9 <?dbhtml filename="addinguser.html"?>
10
[586feb7]11 <title>Adding the CLFS User</title>
[02095ae]12
13 <para>When logged in as user <systemitem class="username">root</systemitem>,
14 making a single mistake can damage or destroy a system. Therefore, we
15 recommend building the packages as an unprivileged user.
16 You could use your own user name, but to make it easier to set up a clean
17 work environment, create a new user called <systemitem
[586feb7]18 class="username">clfs</systemitem> as a member of a new group (also named
19 <systemitem class="groupname">clfs</systemitem>) and use this user during
[02095ae]20 the installation process. As <systemitem class="username">root</systemitem>,
21 issue the following commands to add the new user:</para>
22
[586feb7]23<screen><userinput>groupadd clfs
[76c3eca]24useradd -s /bin/bash -g clfs -d /home/clfs clfs
25mkdir -pv /home/clfs
26chown -v clfs:clfs /home/clfs</userinput></screen>
[02095ae]27
28 <variablelist>
29 <title>The meaning of the command line options:</title>
30
31 <varlistentry>
32 <term><parameter>-s /bin/bash</parameter></term>
33 <listitem>
34 <para>This makes <command>bash</command> the default shell for
[586feb7]35 user <systemitem class="username">clfs</systemitem>.</para>
[02095ae]36 </listitem>
37 </varlistentry>
38
39 <varlistentry>
[586feb7]40 <term><parameter>-g clfs</parameter></term>
[02095ae]41 <listitem>
[586feb7]42 <para>This option adds user <systemitem class="username">clfs</systemitem>
43 to group <systemitem class="groupname">clfs</systemitem>.</para>
[02095ae]44 </listitem>
45 </varlistentry>
46
47 <varlistentry>
[1a09536]48 <term><parameter>clfs</parameter></term>
[02095ae]49 <listitem>
50 <para>This is the actual name for the created group and user.</para>
51 </listitem>
52 </varlistentry>
53
54 </variablelist>
55
[586feb7]56 <para>To log in as <systemitem class="username">clfs</systemitem> (as
57 opposed to switching to user <systemitem class="username">clfs</systemitem>
[02095ae]58 when logged in as <systemitem class="username">root</systemitem>, which
[586feb7]59 does not require the <systemitem class="username">clfs</systemitem> user
60 to have a password), give <systemitem class="username">clfs</systemitem>
[02095ae]61 a password:</para>
62
[586feb7]63<screen><userinput>passwd clfs</userinput></screen>
[02095ae]64
[586feb7]65 <para>Grant <systemitem class="username">clfs</systemitem> full access to
[65df7b1]66 <filename class="directory">${CLFS}</filename> by making <systemitem
[1a09536]67 class="username">clfs</systemitem> the directory's owner:</para>
[02095ae]68
[65df7b1]69<screen><userinput>chown -Rv clfs ${CLFS}</userinput></screen>
[02095ae]70
[586feb7]71 <para>Next, login as user <systemitem class="username">clfs</systemitem>.
[02095ae]72 This can be done via a virtual console, through a display manager, or
73 with the following substitute user command:</para>
74
[586feb7]75<screen><userinput>su - clfs</userinput></screen>
[02095ae]76
77 <para>The <quote><parameter>-</parameter></quote> instructs
78 <command>su</command> to start a login shell as opposed to a non-login
79 shell. The difference between these two types of shells can be found
80 in detail in <filename>bash(1)</filename> and <command>info
81 bash</command>.</para>
82
83</sect1>
Note: See TracBrowser for help on using the repository browser.