source: chapter04/addinguser.xml@ a1a7f4f

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.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 a1a7f4f was a1a7f4f, checked in by Archaic <archaic@…>, 19 years ago

Brought (hopefully) all references of man/info pages into conformity. Updated typography to reflect this.

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