Linux System Administration

0 of 83 lessons complete (0%)

Managing User Accounts

LAB: User Accounts

You don’t have access to this lesson

Please register or sign in to access the course content.

Lab: Customizing User Profiles

Scenario

In this lab, you will act as a system administrator. Your task is to set up a customized user account for a developer named Alice. She needs a specific environment with custom aliases and environment variables to make her development workflow more efficient.

1

Create a New User Account for Alice

Open a terminal and log in as the system administrator. Then, create the new user account.

sudo adduser alice

Follow the on-screen prompts to set a password and provide any other required user information.

2

Customize .bashrc for Alice

First, switch to Alice’s account:

su - alice

Next, edit her .bashrc file to add a custom alias for a frequently used development command. This alias lets Alice run a parallel build with four jobs simply by typing build.

echo "alias build='make -j4'" >> ~/.bashrc
3

Configure .bash_profile

Ensure the customizations in .bashrc are applied when Alice logs in. If .bash_profile doesn’t exist, the first command will create it.

touch ~/.bash_profile
echo "source ~/.bashrc" >> ~/.bash_profile
4

Configure .profile

This ensures that the customizations are also applied when using non-interactive login shells. If .profile doesn’t exist, it will be created.

touch ~/.profile
echo "source ~/.bashrc" >> ~/.profile
5

Test the Customizations

Log out of Alice’s account:

exit

Log back in as Alice. You should now be able to use the custom alias:

build

This command should now initiate a parallel build with four jobs.

Conclusion

You have successfully customized the user profiles for Alice, providing her with a tailored environment for her development tasks. This lab demonstrates the importance of user profiles in creating a personalized and efficient working environment for users with specific needs.