π Day 11 - Linux File Permissions & Ownership


π On Day 11, I explored file permissions, group-based access, and the chmod
/chown
commands to control directory accessβa critical skill for secure Linux administration.
π Step-by-Step Progress
β Directory Setup
Created a new directory:
mkdir /opt/devopsdir
Verified permissions:
ls -ld /opt/devopsdir
π₯ Group & Users Created a group:
groupadd devops
- Created users:
useradd ansible
useradd jenkins
useradd aws
useradd miles
π Change Ownership of the group:
chown -R ansible:devops /opt/devopsdir
π§ Modify Permissions Removed execute permission for others:
chmod o-x /opt/devopsdir
- Removed read permission for others:
chmod o-r /opt/devopsdir
- Gave write access to the group:
chmod g+w /opt/devopsdir
π§ͺ Bonus:
- Created and assigned new directory:
mkdir /opt/webdata
chown aws.devops /opt/webdata
Tested permission variations:
chmod 770 /opt/webdata # Full access to user & group, none for others chmod 000 /opt/webdata # No access to anyone chmod 777 /opt/webdata # Full access to everyone
π Key Takeaways
β Use chown to set owners and groups
β Use chmod to finely control permissions
β Understand rwx for user, group, others
β Always limit access with principle of least privilege
β Useful for securing apps, logs, and DevOps automation tasks
π¬ Example Use Cases in DevOps
Shared directory for deployment logs (group-access only)
Locking sensitive config folders to specific automation users
Securing volumes in container mounts (volumes:/opt/data:ro)
π Whatβs Next? In Day 12, I
βll explore sudo access, visudo, and privilege escalation policies used in real-world DevOps projects!
Subscribe to my newsletter
Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
