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