source: chapter04/addinguser.xml@ 2256873

6.0
Last change on this file since 2256873 was 2256873, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Last edit round.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4265 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.3 KB
Line 
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 LFS User</title>
8<?dbhtml filename="addinguser.html"?>
9
10<para>When logged in as user <emphasis>root</emphasis>, making a
11single mistake can damage or destroy a system. Therefore, we recommend
12building the packages in this chapter as an unprivileged user. You
13could use your own user name, but to make it easier to set up a clean
14work environment, create a new user called <emphasis>lfs</emphasis> as
15a member of a new group (also named <emphasis>lfs</emphasis>) and use
16this user during the installation process. As
17<emphasis>root</emphasis>, issue the following commands to add the new
18user:</para>
19
20<screen><userinput>groupadd lfs
21useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen>
22
23<para>The meaning of the command line options:</para>
24
25<variablelist>
26<varlistentry>
27<term><parameter>-s /bin/bash</parameter></term>
28<listitem><para>This makes
29<command>bash</command> the default shell for user
30<emphasis>lfs</emphasis>.</para></listitem>
31</varlistentry>
32
33<varlistentry>
34<term><parameter>-g lfs</parameter></term>
35<listitem><para>This option adds user <emphasis>lfs</emphasis> to group
36<emphasis>lfs</emphasis>.</para></listitem>
37</varlistentry>
38
39<varlistentry>
40<term><parameter>-m</parameter></term>
41<listitem><para>This creates a home
42directory for <emphasis>lfs</emphasis>.</para></listitem>
43</varlistentry>
44
45<varlistentry>
46<term><parameter>-k /dev/null</parameter></term>
47<listitem><para>This parameter
48prevents possible copying of files from a skeleton directory (default
49is <filename class="directory">/etc/skel</filename>) by changing the input location to
50the special null device.</para></listitem>
51</varlistentry>
52
53<varlistentry>
54<term><parameter>lfs</parameter></term>
55<listitem><para>This is the actual name for the created group and
56user.</para></listitem>
57</varlistentry>
58</variablelist>
59
60<para>To log in as <emphasis>lfs</emphasis> (as opposed to switching
61to user <emphasis>lfs</emphasis> when
62logged in as <emphasis>root</emphasis>, which does not require the
63<emphasis>lfs</emphasis> user to have a
64password), give <emphasis>lfs</emphasis> a password:</para>
65
66<screen><userinput>passwd lfs</userinput></screen>
67
68<para>Grant <emphasis>lfs</emphasis> full access to
69<filename class="directory">$LFS/tools</filename> by making
70<emphasis>lfs</emphasis> the directory owner:</para>
71
72<screen><userinput>chown lfs $LFS/tools</userinput></screen>
73
74<beginpage/>
75<para>If a separate working directory was created as suggested, give
76user <emphasis>lfs</emphasis> ownership of this directory:</para>
77
78<screen><userinput>chown lfs $LFS/sources</userinput></screen>
79
80<para>Next, login as user <emphasis>lfs</emphasis>. This can be done
81via a virtual console, through a display manager, or with the
82following substitute user command:</para>
83
84<screen><userinput>su - lfs</userinput></screen>
85
86<para>The <quote><parameter>-</parameter></quote> instructs
87<command>su</command> to start a login shell as opposed to a non-login
88shell. The difference between these two types of shells can be found
89in detail in the Bash man and info pages.</para>
90
91</sect1>
92
Note: See TracBrowser for help on using the repository browser.