Customizing User Profiles for a Developer
In this lab scenario, you will assume the role of a system administrator responsible for setting up a user account for a developer named Alice. Alice requires a customized environment with specific aliases and environment variables to streamline her development tasks.
Step 1: Creating a New User Account for Alice
- Open a terminal and log in as the system administrator.
- Create a new user account for Alice:
sudo adduser alice
Follow the prompts to set a password and provide additional user information.
Step 2: Customizing .bashrc
for Alice
- Switch to Alice’s account:
su - alice
- Edit Alice’s
.bashrc
file to add custom aliases and environment variables. For example, let’s add an alias for a frequently used development command:echo "alias build='make -j4'" >> ~/.bashrc
This alias will allow Alice to run a parallel build with four jobs using thebuild
command. - Save and exit the text editor.
Step 3: Customizing .bash_profile
for Alice
- If
.bash_profile
doesn’t exist, create it:touch ~/.bash_profile
- Edit Alice’s
.bash_profile
to source the.bashrc
file:echo "source ~/.bashrc" >> ~/.bash_profile
This ensures that the customizations in.bashrc
are applied when Alice logs in. - Save and exit the text editor.
Step 4: Customizing .profile
for Alice
- If
.profile
doesn’t exist, create it:bashCopy codetouch ~/.profile
- Edit Alice’s
.profile
to source the.bashrc
file:echo "source ~/.bashrc" >> ~/.profile
This ensures that the customizations in.bashrc
are applied when using non-interactive login shells. - Save and exit the text editor.
Step 5: Testing the Customizations
- Log out of Alice’s account:bashCopy code
exit
- Log back in as Alice. You should see the custom alias in action:bashCopy code
build
This command should 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.