Linux Access Control Lists (Acls) : 4.1 Review Existing File Permissions
Linux Access Control Lists (Acls) : 4.1 Review Existing File Permissions
Linux Access Control Lists (Acls) : 4.1 Review Existing File Permissions
This lab was developed for the Labtainer framework by the Naval Postgraduate School, Center for
Cybersecurity and Cyber Operations under National Science Foundation Award No. 1438893. This
work is in the public domain, and cannot be copyrighted.
1 Overview
This exercise explores the use of Linux ACLs to provide access control over files, with more flexibility
than the access control offered by traditional UNIX file permissions. It is assumed the student has received
instruction, or independent study, in access control policies and ACLs. A description of Linux ACLs can be
found at https://wiki.archlinux.org/index.php/Access_Control_Lists
2 Lab Environmnet
This lab runs in the Labtainer framework, available at http://my.nps.edu/web/c3o/labtainers. That site in-
cludes links to a pre-built virtual machine that has Labtainers installed, however Labtainers can be run on
any Linux host that supports Docker containers.
From your labtainer-student directory start the lab using:
labtainer acl
3 Setup
After starting the lab, three virtual terminals will be created, each with a login prompt. Login to these as
three different users:
user password
bob password4bob
alice password4alice
harry password4harry
4 Lab Tasks
In this lab, you will use the getfacl and setfacl commands to view and modify ACLs on files. Use
the -h option to learn about these commands, e.g., getfacl -h.
cd /shared_data
ls -l
Labtainers 2
Observe the file permissions on the accounting.txt file and the two directories. Would you expect
Alice to be able to view the content of accounting.txt? Try to cat the file.
Look again at the directory listing. Note how the accounting.txt entry has a permission setting of:
-rw-rw----+
That + symbol at the end indicates that this file has an ACL in addition to the standard UNIX permissions
of ”rw” for user and group. You can view the ACL permissions on this file using:
getfacl accounting.txt
Note how one of the three users has permission to modify that file? Go to that user’s virtual terminal
and append to the file using:
Back in the Alice terminal, try to modify that file to confirm she lacks that access.
• Set the default ACL on the alice directory to permit bob to read newly created files.
• Create another new file in /shared data/alice and check its permissions. Are they what you
expect?
5 Submission
After finishing the lab, go to the terminal on your Linux system that was used to start the lab and type:
stoplab acl
When you stop the lab, the system will display a path to the zipped lab results on your Linux system. Provide
that file to your instructor, e.g., via the Sakai site.