source: BOOK/final-preps/addinguser.xml@ 3d85c53

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 3d85c53 was 3c17f8e, checked in by Jim Gifford <clfs@…>, 19 years ago

r1116@server (orig r1114): chris | 2006-01-30 22:35:31 -0800
Started adding -v to commands that accept it.

  • Property mode set to 100644
File size: 4.1 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-final-preps-addinguser">
9 <?dbhtml filename="addinguser.html"?>
10
11 <title>Adding the LFS User</title>
12
13 <para>When logged in as user <systemitem class="username">root</systemitem>,
14 making a single mistake can damage or destroy a system. Therefore, we
15 recommend building the packages as an unprivileged user.
16 You could use your own user name, but to make it easier to set up a clean
17 work environment, create a new user called <systemitem
18 class="username">lfs</systemitem> as a member of a new group (also named
19 <systemitem class="groupname">lfs</systemitem>) and use this user during
20 the installation process. As <systemitem class="username">root</systemitem>,
21 issue the following commands to add the new user:</para>
22
23<screen><userinput>groupadd lfs
24useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen>
25
26 <variablelist>
27 <title>The meaning of the command line options:</title>
28
29 <varlistentry>
30 <term><parameter>-s /bin/bash</parameter></term>
31 <listitem>
32 <para>This makes <command>bash</command> the default shell for
33 user <systemitem class="username">lfs</systemitem>.</para>
34 </listitem>
35 </varlistentry>
36
37 <varlistentry>
38 <term><parameter>-g lfs</parameter></term>
39 <listitem>
40 <para>This option adds user <systemitem class="username">lfs</systemitem>
41 to group <systemitem class="groupname">lfs</systemitem>.</para>
42 </listitem>
43 </varlistentry>
44
45 <varlistentry>
46 <term><parameter>-m</parameter></term>
47 <listitem>
48 <para>This creates a home directory for <systemitem
49 class="username">lfs</systemitem>.</para>
50 </listitem>
51 </varlistentry>
52
53 <varlistentry>
54 <term><parameter>-k /dev/null</parameter></term>
55 <listitem>
56 <para>This parameter prevents possible copying of files from a skeleton
57 directory (default is <filename class="directory">/etc/skel</filename>)
58 by changing the input location to the special null device.</para>
59 </listitem>
60 </varlistentry>
61
62 <varlistentry>
63 <term><parameter>lfs</parameter></term>
64 <listitem>
65 <para>This is the actual name for the created group and user.</para>
66 </listitem>
67 </varlistentry>
68
69 </variablelist>
70
71 <para>To log in as <systemitem class="username">lfs</systemitem> (as
72 opposed to switching to user <systemitem class="username">lfs</systemitem>
73 when logged in as <systemitem class="username">root</systemitem>, which
74 does not require the <systemitem class="username">lfs</systemitem> user
75 to have a password), give <systemitem class="username">lfs</systemitem>
76 a password:</para>
77
78<screen><userinput>passwd lfs</userinput></screen>
79
80 <para>Grant <systemitem class="username">lfs</systemitem> full access to
[6b369e9]81 <filename class="directory">$LFS</filename>,
82 <filename class="directory">$LFS/cross-tools</filename>,
83 and <filename class="directory">$LFS/tools</filename> by making <systemitem
[8659630]84 class="username">lfs</systemitem> the directorys' owner:</para>
[3f8be484]85
[3c17f8e]86<screen><userinput>chown -v lfs $LFS
87chown -v lfs $LFS/tools
88chown -v lfs $LFS/cross-tools</userinput></screen>
[3f8be484]89
[8659630]90 <para>If a separate working directory was created as suggested,
91 give user <systemitem class="username">lfs</systemitem> ownership of this directory:</para>
[3f8be484]92
[3c17f8e]93<screen><userinput>chown -v lfs $LFS/sources</userinput></screen>
[3f8be484]94
95 <para>Next, login as user <systemitem class="username">lfs</systemitem>.
96 This can be done via a virtual console, through a display manager, or
97 with the following substitute user command:</para>
98
99<screen><userinput>su - lfs</userinput></screen>
100
101 <para>The <quote><parameter>-</parameter></quote> instructs
102 <command>su</command> to start a login shell as opposed to a non-login
103 shell. The difference between these two types of shells can be found
104 in detail in <filename>bash(1)</filename> and <command>info
105 bash</command>.</para>
106
107</sect1>
Note: See TracBrowser for help on using the repository browser.