Multi-User Secure File Sharing System with ACLs on Red Hat Linux

Multi-User Secure File Sharing System with ACLs on Red Hat Linux


Today I built a secure shared file space using Access Control Lists (ACLs) on Red Hat Linux.

This project is very practical and directly aligns with RHCSA exam tasks around user permissions, groups, and access control.

🔧 Objective

  • Create a shared folder for multiple users
  • Apply ACLs to define fine-grained permissions
  • Test and verify ACL behavior with different users

📚 RHCSA Skills Covered

✔ User and group creation

✔ Setting standard and extended permissions

✔ Using setfacl and getfacl for ACL management

✔ Troubleshooting permissions

1️⃣ Create Users and Groups

sudo useradd alice
sudo useradd bob
sudo useradd charlie
sudo passwd alice
sudo passwd bob
sudo passwd charlie

Image description

2️⃣ Create a Shared Directory

sudo mkdir /shared
sudo chown root:root /shared
sudo chmod 770 /shared

Image description

This allows only the owner and group members to access by default.

3️⃣ Apply ACLs for Fine-Grained Control

Grant full access to alice, read-only access to bob, and deny access to charlie.

sudo setfacl -m u:alice:rwx /shared
sudo setfacl -m u:bob:r– /shared
sudo setfacl -m u:charlie:— /shared

Image description

4️⃣ Verify ACLs

getfacl /shared

Example output:

user::rwx
user:alice:rwx
user:bob:r–
user:charlie:—
group::—
mask::rwx
other::—

Image description

5️⃣ Test Permissions

Switch to each user to test access:
su – alice
cd /shared
touch testfile.txt

su – bob
cd /shared
ls # should work
touch newfile.txt # should fail

su – charlie
cd /shared # should fail

🧪 Try It Yourself

Create a “Finance” group with specific ACL access to /finance

Remove ACLs with setfacl -x

Make default ACLs apply to all new files in /shared:
sudo setfacl -d -m u:alice:rwx /shared

✅ Recap

TaskTool/Command
Create users useradd, passwd
Create shared folder mkdir /shared, chmod 770
Apply ACLssetfacl -m u:user:perm /path
View ACLsgetfacl /shared
Remove ACLssetfacl -x u:user /shared

🎯 Why This Matters (RHCSA)

ACLs provide fine-grained access control that regular Linux permissions cannot.

RHCSA tests your ability to:

  • Set, modify, and remove ACLs
  • Combine ACLs with standard permissions
  • Troubleshoot permission issues

This is an ideal exam and real-world scenario for securing shared data.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *