source: chapter04/addinguser.xml@ 9c9d585

Last change on this file since 9c9d585 was 966c6512, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (chapter04/*.xml) RELAX NG validation fixes

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

  • Property mode set to 100644
File size: 2.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<section xmlns="http://docbook.org/docbook-ng"
7 xml:id="ch-tools-addinguser">
8<info><title>Adding the user lfs</title></info>
9<?dbhtml filename="addinguser.html"?>
10
11<para>When logged in as <emphasis>root</emphasis>, making a single mistake
12can damage or even wreck your system. Therefore we recommend that you
13build the packages in this chapter as an unprivileged user. You could
14of course use your own user name, but to make it easier to set up a clean
15work environment we'll create a new user <emphasis>lfs</emphasis> as a
16member of a new group (also named <emphasis>lfs</emphasis>) and
17use this one during the installation process. As <emphasis>root</emphasis>,
18issue the following commands to add the new user:</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 switches:</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 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</variablelist>
53
54<para>If you want to be able to log in as <emphasis>lfs</emphasis>, then give
55<emphasis>lfs</emphasis> a password:</para>
56
57<screen><userinput>passwd lfs</userinput></screen>
58
59<para>and grant <emphasis>lfs</emphasis> full access to
60<filename class="directory">$LFS/tools</filename> by making
61<emphasis>lfs</emphasis> the directory owner:</para>
62
63<screen><userinput>chown lfs $LFS/tools</userinput></screen>
64
65<para>If you made a separate working directory as suggested, give user
66<emphasis>lfs</emphasis> ownership of this directory too:</para>
67
68<screen><userinput>chown lfs $LFS/sources</userinput></screen>
69
70<para>Next, login as user <emphasis>lfs</emphasis>. This can be done via a
71virtual console, through a display manager, or with the following substitute
72user command:</para>
73
74<screen><userinput>su - lfs</userinput></screen>
75
76<para>The <quote><parameter>-</parameter></quote> instructs <command>su</command> to
77start a <emphasis>login</emphasis> shell.</para>
78
79</section>
Note: See TracBrowser for help on using the repository browser.