source: clfs-embedded/BOOK/final-preps/addinguser.xml@ e24b7ec

Last change on this file since e24b7ec was e24b7ec, checked in by Andrew Bradford <andrew@…>, 7 years ago

final-preps/addinguser: Add notice that actions may need to be done by root

  • Property mode set to 100644
File size: 3.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/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 CLFS 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">clfs</systemitem> as a member of a new group (also named
19 <systemitem class="groupname">clfs</systemitem>) and use this user during
20 the installation process. You may need to do this as the root user:</para>
21
22<screen><userinput>sudo groupadd clfs
23sudo useradd -s /bin/bash -g clfs -m -k /dev/null clfs</userinput></screen>
24
25 <variablelist>
26 <title>The meaning of the command line options:</title>
27
28 <varlistentry>
29 <term><parameter>-s /bin/bash</parameter></term>
30 <listitem>
31 <para>This makes <command>bash</command> the default shell for
32 user <systemitem class="username">clfs</systemitem>.</para>
33 </listitem>
34 </varlistentry>
35
36 <varlistentry>
37 <term><parameter>-g clfs</parameter></term>
38 <listitem>
39 <para>This option adds user <systemitem class="username">clfs</systemitem>
40 to group <systemitem class="groupname">clfs</systemitem>.</para>
41 </listitem>
42 </varlistentry>
43
44 <varlistentry>
45 <term><parameter>-m</parameter></term>
46 <listitem>
47 <para>This creates a home directory for <systemitem
48 class="username">clfs</systemitem>.</para>
49 </listitem>
50 </varlistentry>
51
52 <varlistentry>
53 <term><parameter>-k /dev/null</parameter></term>
54 <listitem>
55 <para>This parameter prevents possible copying of files from a skeleton
56 directory (default is <filename class="directory">/etc/skel</filename>)
57 by changing the input location to the special null device.</para>
58 </listitem>
59 </varlistentry>
60
61 <varlistentry>
62 <term><parameter>clfs</parameter></term>
63 <listitem>
64 <para>This is the actual name for the created group and user.</para>
65 </listitem>
66 </varlistentry>
67
68 </variablelist>
69
70 <para>To log in as <systemitem class="username">clfs</systemitem> (as
71 opposed to switching to user <systemitem class="username">clfs</systemitem>
72 when logged in as <systemitem class="username">root</systemitem>, which
73 does not require the <systemitem class="username">clfs</systemitem> user
74 to have a password), give <systemitem class="username">clfs</systemitem>
75 a password. You may need to do this as the root user:</para>
76
77<screen><userinput>sudo passwd clfs</userinput></screen>
78
79 <para>Grant <systemitem class="username">clfs</systemitem> full access to
80 <filename class="directory">${CLFS}</filename> by making <systemitem
81 class="username">clfs</systemitem> the directory's owner. You may need to do
82 this as the root user:</para>
83
84<screen><userinput>sudo chown -Rv clfs ${CLFS}</userinput></screen>
85
86 <para>Next, login as user <systemitem class="username">clfs</systemitem>.
87 This can be done via a virtual console, through a display manager, or
88 with the following substitute user command:</para>
89
90<screen><userinput>su - clfs</userinput></screen>
91
92 <para>The <quote><parameter>-</parameter></quote> instructs
93 <command>su</command> to start a login shell as opposed to a non-login
94 shell. The difference between these two types of shells can be found
95 in detail in <filename>bash(1)</filename> and <command>info
96 bash</command>.</para>
97
98</sect1>
Note: See TracBrowser for help on using the repository browser.