πŸ“ 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!

0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir