Lab -Access Control Copyyyyyyy
Lab -Access Control Copyyyyyyy
Date: 24-03-25
Prerequisites:
• Basic knowledge of Linux command-line interface.
• Kali Linux installed (physical or virtual environment).
• A user account with administrative privileges.
Lab Exercises:
Exercise 1: Understanding File and Directory Permissions
Step 1: Viewing File Permissions
Output Example:
Breakdown:
r: Read permission
w: Write permission
x: Execute permission
Exercise 2: Modifying File and Directory Permissions Using chmod
2. Assign read (r), write (w), and execute (x) permissions to the
myfile.txt
(Others) = No permission
Exercise 3: Changing File Ownership and Group Ownership
Step 1: Changing File Owner
ls -l myfile.txt
4. Step 2: Changing Group
Ownership
groupadd testgroup
testgroup myfile.txt
ls -l myfile.txt
Exercise 4: Exploring Special Permissions (SUID, SGID, Sticky Bit)
/usr/bin/passwd
Output Example:
• When applied to directories, new files inherit the group ownership of the
directory.
1. Assign SGID to a
directory: mkdir
shared_dir
2. Verify: ls -ld
shared_dir Step 3:
Sticky Bit
• Prevents users from deleting files they don’t own in a shared directory.
chmod +t /tmp
2. Verify: ls -ld /tmp o t at the end (drwxrwxrwt) confirms the sticky bit
is set.
Conclusion:
In this lab, we explored Discretionary Access Control (DAC) in Kali
Linux, including managing file and directory permissions, changing
ownership, and implementing special permissions. These skills are
crucial for securing a Linux system and controlling access based on user
privileges.
Additional Tasks:
• Create multiple users and test access restrictions.
• Try modifying files as different users.
• Explore Access Control Lists (ACLs) for more granular control.
Explanation of Below Pic: The file likely exists but is not accessible to user2 due
to:
Permissions: The file has 600 permissions, meaning only user1 can read or
write it.
Location: If the file is in user1's home directory, user2 may not have
permission to access that directory.
References: