more clarification of "log in as lfs user"

And, don't recommended to "log in as lfs through a DM" anymore: if you
log in through a DM then start a terminal emulator, the first shell in
the emulator is often a non-login shell.  It's not something we expect.
This commit is contained in:
Xi Ruoyao 2022-09-29 18:26:52 +08:00
parent 199d14c997
commit aa9ade1fba
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
2 changed files with 12 additions and 10 deletions

View File

@ -68,11 +68,11 @@ useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen>
</variablelist> </variablelist>
<para>To enable logging in as <systemitem class="username">lfs</systemitem> (as opposed <para>If you want to log in as &lfs-user; or switch to &lfs-user; from a
to switching to user <systemitem class="username">lfs</systemitem> when logged non-&root; user (as opposed to switching to user &lfs-user;
in as <systemitem class="username">root</systemitem>, which does not require when logged in as &root;, which does not require the &lfs-user; user to
the <systemitem class="username">lfs</systemitem> user to have a password), have a password), you need to set a password of &lfs-user;. Issue the
give <systemitem class="username">lfs</systemitem> a password:</para> following command as the &root; user to set the password:</para>
<screen role="nodump"><userinput>passwd lfs</userinput></screen> <screen role="nodump"><userinput>passwd lfs</userinput></screen>
@ -90,9 +90,9 @@ esac</userinput></screen>
If the prompt "lfs:~$" does not appear immediately, entering the If the prompt "lfs:~$" does not appear immediately, entering the
<command>fg</command> command will fix the issue.</para></note> <command>fg</command> command will fix the issue.</para></note>
<para>Next, login as user <systemitem class="username">lfs</systemitem>. <para>Next, start a shell running as user &lfs-user;. This can be done by
This can be done via a virtual console, through a display manager, or with logging in as &lfs-user; on a virtual console, or with the following
the following substitute/switch user command:</para> substitute/switch user command:</para>
<screen role="nodump"><userinput>su - lfs</userinput></screen> <screen role="nodump"><userinput>su - lfs</userinput></screen>

View File

@ -19,8 +19,10 @@
<literal>exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash</literal> <literal>exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash</literal>
EOF</userinput></screen> EOF</userinput></screen>
<para>When logged on as user <systemitem class="username">lfs</systemitem>, <para>When logged on as user <systemitem class="username">lfs</systemitem>
the initial shell is usually a <emphasis>login</emphasis> shell which reads or switched to the &lfs-user; user using a <command>su</command> command
with <quote><parameter>-</parameter></quote> option,
the initial shell is a <emphasis>login</emphasis> shell which reads
the <filename>/etc/profile</filename> of the host (probably containing some the <filename>/etc/profile</filename> of the host (probably containing some
settings and environment variables) and then <filename>.bash_profile</filename>. settings and environment variables) and then <filename>.bash_profile</filename>.
The <command>exec env -i.../bin/bash</command> command in the The <command>exec env -i.../bin/bash</command> command in the