Adding the user lfs

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:

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.