In this lab, we’ll review what file access lists (FACLs) are used for. We’ll set up a FACL to restrict access to a single file. We’ll implement one rule to permit access for a single user, and then we’ll edit permissions to remove access for all other users.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create user account `pjohnson` and the project directory and file.
- Create the user account
pjohnson
with the following command:sudo useradd pjohnson
- Create the project directory with the following command:
sudo mkdir /project51
- Create the
TPSreport.txt
file in the/project51
directory with the following command:sudo touch /project51/TPSreport.txt
- Create the user account
- Create FACL to permit user `pjohnson` access to file `TPSreprot.txt`.
Create a FACL for
/project51/TPSreport.txt
permitting userpjohnson
RWX access:sudo setfacl -m u:pjohnson:rwx /project51/TPSreport.txt
- Remove access for other users from the file `/project51/TPSreport.txt`.
To remove other users’ access, use the following command:
sudo chmod o-rwx /project51/TPSreport.txt