source: chapter04/addinguser.xml@ 81fd230

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 81fd230 was 81fd230, checked in by Gerard Beekmans <gerard@…>, 19 years ago

Trunk is now identical to Testing

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 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.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/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<para>If a separate working directory was created as suggested, give
75user <emphasis>lfs</emphasis> ownership of this directory:</para>
76
77<screen><userinput>chown lfs $LFS/sources</userinput></screen>
78
79<para>Next, login as user <emphasis>lfs</emphasis>. This can be done
80via a virtual console, through a display manager, or with the
81following substitute user command:</para>
82
83<screen><userinput>su - lfs</userinput></screen>
84
85<para>The <quote><parameter>-</parameter></quote> instructs
86<command>su</command> to start a login shell as opposed to a non-login
87shell. The difference between these two types of shells can be found
88in detail in the Bash man and info pages.</para>
89
90</sect1>
91
Note: See TracBrowser for help on using the repository browser.