Linux System Administration

0 of 83 lessons complete (0%)

Managing User Accounts

LAB: Home Directories

You don’t have access to this lesson

Please register or sign in to access the course content.

Lab: Home Directories

Managing User Home Directories and Permissions

Scenario

You are a system administrator responsible for setting up user accounts on a Linux server. A new developer, Bob, has joined the team, and you need to create his user account, set up his home directory, and configure appropriate permissions.

1

Create Bob’s User Account

Use the adduser command to create Bob’s user account and set his password when prompted.

sudo adduser bob
2

Verify Bob’s Home Directory

Confirm that Bob’s home directory has been created under /home.

ls /home
3

Inspect Default Permissions

Use ls -l to view the permissions of Bob’s home directory and note the defaults.

ls -l /home/bob
4

Customize Bob’s .bashrc

First, switch to Bob’s account:

su - bob

Next, add a custom alias for a deployment script to his .bashrc file.

echo "alias deploy='./deploy_script.sh'" >> ~/.bashrc
5

Set Default Permissions for New Files

Check Bob’s current umask setting to see the default file permissions. You can modify this if needed to adjust defaults.

umask
6

Test the Customization

Log out of Bob’s account:

exit

Log back in as Bob and test the newly created alias:

deploy
7

Verify Permissions

Check the permissions of the files and directories in Bob’s home directory again to ensure they reflect any customizations made.

ls -l /home/bob

Conclusion

In this exercise, you have successfully created a new user account for Bob, customized his .bashrc, and reviewed default permissions. This demonstrates how system administrators can tailor user environments to suit specific needs while maintaining security and privacy.