0% found this document useful (0 votes)
5 views4 pages

Linux Access Control Experiment

The document outlines a hands-on experiment for understanding and modifying Linux access control, focusing on file permissions, user and group management, and Access Control Lists (ACLs). It includes detailed steps for creating users, changing file permissions, and exploring SUID, SGID, and Sticky Bit behaviors. The lab requires a Linux VM and includes reflection questions to assess understanding of access control concepts.

Uploaded by

Nayla Greige
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Linux Access Control Experiment

The document outlines a hands-on experiment for understanding and modifying Linux access control, focusing on file permissions, user and group management, and Access Control Lists (ACLs). It includes detailed steps for creating users, changing file permissions, and exploring SUID, SGID, and Sticky Bit behaviors. The lab requires a Linux VM and includes reflection questions to assess understanding of access control concepts.

Uploaded by

Nayla Greige
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Linux Access Control: Detailed Hands-

on Experiment
Objectives

- Understand and modify Linux file permissions (read, write, execute).


- Manage users and groups.
- Apply Access Control Lists (ACLs) for fine-grained permissions.
- Explore SUID, SGID, and Sticky Bit behavior.
- Identify potential misconfigurations.

Lab Environment

- Linux VM (e.g., Ubuntu, Debian, or Kali)


- User access with sudo privileges

Part 1: File Permissions and Ownership

Step 1.1: Create Users and Files

sudo adduser alice


sudo adduser bob
sudo adduser charlie

mkdir /home/testaccess
touch /home/testaccess/secret.txt
sudo chown alice:alice /home/testaccess/secret.txt
sudo chmod 600 /home/testaccess/secret.txt

Q1: What permissions does secret.txt now have?

Q2: Can bob or charlie read this file? Try:

sudo -u bob cat /home/testaccess/secret.txt


Step 1.2: Change File Permissions
sudo chmod 640 /home/testaccess/secret.txt

Q3: What does 640 mean in permission terms?

Q4: Which users or groups now have access?

Part 2: Groups and Shared Access

Step 2.1: Create a Group and Share a File

sudo groupadd devteam


sudo usermod -aG devteam bob
sudo usermod -aG devteam charlie

sudo chgrp devteam /home/testaccess/secret.txt


sudo chmod 660 /home/testaccess/secret.txt

Q5: Who can now read/write the file?

Q6: What is the role of the group ownership here?

Part 3: Access Control Lists (ACLs)

Step 3.1: Set ACLs

sudo apt install acl # If not already installed


sudo setfacl -m u:bob:r-- /home/testaccess/secret.txt
sudo setfacl -m u:charlie:rw- /home/testaccess/secret.txt

getfacl /home/testaccess/secret.txt

Q7: What permissions were assigned to bob and charlie?

Q8: How do ACLs override standard Unix permissions?

Part 4: SUID, SGID, and Sticky Bit

Step 4.1: Explore SUID

sudo cp /bin/ping /home/testaccess/pingtest


sudo chmod u+s /home/testaccess/pingtest
ls -l /home/testaccess/pingtest

Q9: What does the s indicate in the permissions?

Q10: What happens when a regular user runs pingtest?

Step 4.2: SGID and Group Inheritance

mkdir /home/testaccess/devdir
sudo chgrp devteam /home/testaccess/devdir
sudo chmod 2770 /home/testaccess/devdir

sudo -u bob touch /home/testaccess/devdir/test.txt


ls -l /home/testaccess/devdir

Q11: What group owns the file test.txt?

Step 4.3: Sticky Bit in Shared Directories

sudo chmod +t /home/testaccess/devdir

sudo -u charlie rm /home/testaccess/devdir/test.txt

Q12: What happened? Why?

Reflection Questions
1. Why are file permissions crucial for access control?

2. How can ACLs help in environments with complex sharing needs?

3. What are the risks of misconfigured SUID or SGID binaries?

4. How does the sticky bit improve security in shared folders?

Lab Deliverables Checklist

- Screenshots of file and directory creation and permission settings.


- Screenshot showing output of getfacl for secret.txt.
- Screenshot showing the use and effect of SUID, SGID, and sticky bit.
- Written answers to all reflection and guided questions.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy