source: chapter04/addinguser.xml@ 700f9b7

Last change on this file since 700f9b7 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
RevLine 
[673b0d8]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">
[69993f4]7<title>Adding the LFS User</title>
[673b0d8]8<?dbhtml filename="addinguser.html"?>
9
[78349b7]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>
[673b0d8]19
[1fd5d19]20<screen><userinput>groupadd lfs
21useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen>
[673b0d8]22
[78349b7]23<para>The meaning of the command line options:</para>
[673b0d8]24
[55851d6]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
[673b0d8]30<emphasis>lfs</emphasis>.</para></listitem>
[55851d6]31</varlistentry>
[673b0d8]32
[1fd5d19]33<varlistentry>
34<term><parameter>-g lfs</parameter></term>
[69993f4]35<listitem><para>This option adds user <emphasis>lfs</emphasis> to group
[2256873]36<emphasis>lfs</emphasis>.</para></listitem>
[1fd5d19]37</varlistentry>
38
[55851d6]39<varlistentry>
40<term><parameter>-m</parameter></term>
41<listitem><para>This creates a home
[673b0d8]42directory for <emphasis>lfs</emphasis>.</para></listitem>
[55851d6]43</varlistentry>
[673b0d8]44
[55851d6]45<varlistentry>
46<term><parameter>-k /dev/null</parameter></term>
47<listitem><para>This parameter
[673b0d8]48prevents possible copying of files from a skeleton directory (default
[55851d6]49is <filename class="directory">/etc/skel</filename>) by changing the input location to
[673b0d8]50the special null device.</para></listitem>
[55851d6]51</varlistentry>
[78349b7]52
53<varlistentry>
54<term><parameter>lfs</parameter></term>
[69993f4]55<listitem><para>This is the actual name for the created group and
[2256873]56user.</para></listitem>
[78349b7]57</varlistentry>
[55851d6]58</variablelist>
[673b0d8]59
[78349b7]60<para>To log in as <emphasis>lfs</emphasis> (as opposed to switching
61to user <emphasis>lfs</emphasis> when
[69993f4]62logged in as <emphasis>root</emphasis>, which does not require the
[78349b7]63<emphasis>lfs</emphasis> user to have a
[69993f4]64password), give <emphasis>lfs</emphasis> a password:</para>
[673b0d8]65
66<screen><userinput>passwd lfs</userinput></screen>
67
[78349b7]68<para>Grant <emphasis>lfs</emphasis> full access to
[673b0d8]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
[38bb44a]74<beginpage/>
[78349b7]75<para>If a separate working directory was created as suggested, give
[e12c714]76user <emphasis>lfs</emphasis> ownership of this directory:</para>
[673b0d8]77
78<screen><userinput>chown lfs $LFS/sources</userinput></screen>
79
[78349b7]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>
[673b0d8]83
84<screen><userinput>su - lfs</userinput></screen>
85
[78349b7]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>
[673b0d8]90
91</sect1>
[78349b7]92
Note: See TracBrowser for help on using the repository browser.