Managing File Ownership and Permissions

1.75 hours
  • 5 Learning Objectives

About this Hands-on Lab

In this hands-on lab, we will practice managing Linux file and directory ownership and permissions. Having a solid understanding of ownership and permissions is a fundamental skill for Linux systems administration.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Lock Bill’s, Susan’s, and Juan’s Accounts
  1. Run the following command:
    for i in bill susan juan; do sudo passwd -l $i; done
Create Accounts for Nancy, Greg, and Jeremy
  1. Run the following commands:
    sudo useradd -m nancy
    sudo useradd -m greg
    sudo useradd -m jeremy
Remove Bill as a User and Transfer Ownership of his Home Directory
  1. Remove the user bill.
    sudo userdel bill
  2. Change the ownership of Bill’s home directory (recursively) to the user nancy and the group jason.
    sudo chown -R nancy:jason /home/bill
  3. Change the mode of the directory to grant read and execute permissions to the group.
    sudo chmod g+rx /home/bill
Remove Susan as a User and Transfer Ownership of her Home Directory
  1. Remove the user susan.
    sudo userdel susan
  2. Change the ownership of Susan’s home directory (recursively) to the user greg and the group jason.
    sudo chown -R greg:jason /home/susan
  3. Change the mode of the directory to grant read and execute permissions to the group.
    sudo chmod g+rx /home/susan
Remove Juan as a User and Transfer Ownership of His Home Directory
  1. Remove the user juan.
    sudo userdel juan
  2. Change the ownership of Juan’s home directory (recursively) to the user jeremy and the group sally.
    sudo chown -R jeremy:sally /home/juan
  3. Change the mode of the directory to grant read and execute permissions to the group.
    sudo chmod g+rx /home/juan

Additional Resources

Several users have left your organization. You must modify the permissions of their files and directories to make them available to both their managers and the new employees taking over their tasks.

The following employees have left: Bill, Susan, and Juan.

Bill and Susan reported to Jason, and Juan reported to Sally. Bill was replaced by Nancy, Susan was replaced by Greg, and Juan was replaced by Jeremy.

The transfer of ownership should be as follows:

  • Bill --> Nancy and Jason
  • Susan --> Greg and Jason
  • Juan --> Jeremy and Sally

Use both user and group permissions to achieve this outcome.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?