Changeset 6a3b6af for chapter04/addinguser.xml
- Timestamp:
- 01/15/2006 12:10:43 PM (18 years ago)
- Branches:
- 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
- Children:
- 3467c02f
- Parents:
- b0ed1af
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter04/addinguser.xml
rb0ed1af r6a3b6af 1 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" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="ch-tools-addinguser"> 7 <title>Adding the LFS User</title> 8 <?dbhtml filename="addinguser.html"?> 9 <?dbhtml filename="addinguser.html"?> 9 10 10 <para>When logged in as user <emphasis>root</emphasis>, making a single mistake 11 can damage or destroy a system. Therefore, we recommend building the packages in 12 this chapter as an unprivileged user. You could use your own user name, but to 13 make 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 17 user:</para> 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 in this chapter as an unprivileged user. 16 You could use your own user name, but to make it easier to set up a clean 17 working 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> 18 22 19 23 <screen><userinput>groupadd lfs 20 24 useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen> 21 25 22 <para>The meaning of the command line options:</para> 26 <variablelist> 27 <title>The meaning of the command line options:</title> 23 28 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>29 <varlistentry> 30 <term><parameter>-s /bin/bash</parameter></term> 31 <listitem> 32 <para>This makes <command>bash</command> the default shell for user 33 <systemitem class="username">lfs</systemitem>.</para> 34 </listitem> 35 </varlistentry> 31 36 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 <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> 37 44 38 <varlistentry> 39 <term><parameter>-m</parameter></term> 40 <listitem><para>This creates a home 41 directory for <emphasis>lfs</emphasis>.</para></listitem> 42 </varlistentry> 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> 43 52 44 <varlistentry> 45 <term><parameter>-k /dev/null</parameter></term> 46 <listitem><para>This parameter 47 prevents possible copying of files from a skeleton directory (default 48 is <filename class="directory">/etc/skel</filename>) by changing the input location to 49 the special null device.</para></listitem> 50 </varlistentry> 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> 51 61 52 <varlistentry>53 <term><parameter>lfs</parameter></term>54 <listitem><para>This is the actual name for the created group and 55 user.</para></listitem>56 </varlistentry>57 </variablelist>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> 58 68 59 <para>To log in as <emphasis>lfs</emphasis> (as opposed to switching 60 to user <emphasis>lfs</emphasis> when 61 logged in as <emphasis>root</emphasis>, which does not require the 62 <emphasis>lfs</emphasis> user to have a 63 password), give <emphasis>lfs</emphasis> a password:</para> 69 </variablelist> 70 71 <para>To log in as <systemitem class="username">lfs</systemitem> (as opposed 72 to switching to user <systemitem class="username">lfs</systemitem> when logged 73 in as <systemitem class="username">root</systemitem>, which does not require 74 the <systemitem class="username">lfs</systemitem> user to have a password), 75 give <systemitem class="username">lfs</systemitem> a password:</para> 64 76 65 77 <screen role="nodump"><userinput>passwd lfs</userinput></screen> 66 78 67 <para>Grant <emphasis>lfs</emphasis> full access to68 <filename class="directory">$LFS/tools</filename> by making69 <emphasis>lfs</emphasis> the directory owner:</para>79 <para>Grant <systemitem class="username">lfs</systemitem> full access to 80 <filename class="directory">$LFS/tools</filename> by making 81 <systemitem class="username">lfs</systemitem> the directory owner:</para> 70 82 71 83 <screen><userinput>chown -v lfs $LFS/tools</userinput></screen> 72 84 73 <para>If a separate working directory was created as suggested, give 74 user <emphasis>lfs</emphasis> ownership of this directory:</para> 85 <para>If a separate working directory was created as suggested, give 86 user <systemitem class="username">lfs</systemitem> ownership of this 87 directory:</para> 75 88 76 89 <screen><userinput>chown -v lfs $LFS/sources</userinput></screen> 77 90 78 <para>Next, login as user <emphasis>lfs</emphasis>. This can be done 79 via a virtual console, through a display manager, or with the 80 following substitute user command:</para>91 <para>Next, login as user <systemitem class="username">lfs</systemitem>. 92 This can be done via a virtual console, through a display manager, or with 93 the following substitute user command:</para> 81 94 82 <screen ><userinput>su - lfs</userinput></screen>95 <screen role="nodump"><userinput>su - lfs</userinput></screen> 83 96 84 <para>The <quote><parameter>-</parameter></quote> instructs85 <command>su</command> to start a login shell as opposed to a non-login shell.86 The difference between these two types of shells can be found in detail in87 <filename>bash(1)</filename> and <command>info bash</command>.</para>97 <para>The <quote><parameter>-</parameter></quote> instructs 98 <command>su</command> to start a login shell as opposed to a non-login shell. 99 The difference between these two types of shells can be found in detail in 100 <filename>bash(1)</filename> and <command>info bash</command>.</para> 88 101 89 102 </sect1> 90
Note:
See TracChangeset
for help on using the changeset viewer.