When logged in as root, making a single mistake can damage or even wreck your system. Therefore we recommend that you build the packages in this chapter as an unprivileged user. You could of course use your own user name, but to make it easier to set up a clean work environment we'll create a new user lfs and use this one during the installation process. As root, issue the following command to add the new user:
useradd -s /bin/bash -m -k /dev/null lfs
The meaning of the switches:
-s /bin/bash: This makes bash the default shell for user lfs.
-m: This creates a home directory for lfs.
-k /dev/null: This parameter prevents possible copying of files from a skeleton directory (default is /etc/skel) by changing the input location to the special null device.
If you want to be able to log in as lfs, then give lfs a password:
passwd lfs
and grant lfs full access to $LFS/tools by making lfs the directory owner:
chown lfs $LFS/tools
If you made a separate working directory as suggested, give user lfs ownership of this directory too:
chown lfs $LFS/sources
Next, login as user lfs. This can be done via a virtual console, through a display manager, or with the following substitute user command:
su - lfs
The “-” instructs su to start a login shell.