#90daysofdevops { Day -6}

Nikhil KathaleNikhil Kathale
4 min read

Day 6: Understanding Linux File Permissions and Access Control Lists (ACL)

Greetings, fellow tech enthusiasts! 🌐 Today, in the "WHAT THE HECK IS DEOPS?" series we embark on a thrilling journey into the heart of Linux as we unravel the mysteries of File Permissions and Access Control Lists (ACLs). πŸš€πŸ’»

To kick things off, let's create a simple file and unravel its secrets using the ls -ltr command. πŸ‘€πŸ“„

bashCopy codetouch my_file.txt
ls -ltr

Behold the details, as time travels in reverse, unveiling the birth of our file! β³πŸš€

Understanding the Three Guardians:

In the vast Linux universe, file permissions are guarded by three categories of users:

  1. Owner πŸ‘‘ β€” The sovereign ruler of the file or application.

    • chown πŸ‘‘πŸ”’ β€” The command to change the ownership permission.
  2. Group πŸ‘₯ β€” The trusted alliance that owns the file or application.

    • chgrp πŸ‘₯πŸ”’ β€” The command to change the group permission.
  3. Others 🌐 β€” All users with access to the system, outside the owner and group.

    • chmod πŸŒπŸ”’ β€” The command to change other users' permissions.

Task Time:

As a thrilling task, let's alter the user permissions of our file and witness the metamorphosis using ls -ltr!

bashCopy codechmod u+rwx my_file.txt
ls -ltr

Feel the power as you grant or revoke permissions with the command line! πŸš€πŸ”‘

Crafting the Article:

In the enchanting land of Linux, understanding file permissions is like holding the keys to a digital fortress. Each user category, owner, group, and others, plays a crucial role in securing our digital assets. πŸ›‘οΈπŸ”’

Changing ownership with chown, adjusting group permissions with chgrp, and manipulating others' access with chmod are the spells every Linux sorcerer must master. πŸ‘¨β€πŸŽ“βœ¨

Now, let's delve into the mystical world of Access Control Lists (ACLs). πŸ§™β€β™‚οΈβœ¨

ACL Magic:

ACLs provide an extra layer of control over files and directories. The spells getfacl and setfacl allow us to gaze into and alter these magical lists.

bashCopy codegetfacl my_file.txt
setfacl -m u:username:rw my_file.txt

Unlock the secrets of extended permissions and command your files with precision! πŸŒŸπŸ”“

In the mesmerizing realm of Linux, file permissions dance to the rhythm of three enchanting actions: read πŸ“–, write πŸ“, and execute πŸƒβ€β™‚οΈ. These permissions, woven into the fabric of the system, bestow magical powers upon different categories of users: owner (u) πŸ‘‘, group (g) πŸ‘₯, and others (o) 🌐. Let's decode the mystical meanings of these permissions:

  1. Read (r) πŸ“–:

    • File: Users with "read" permission can peer into the secrets of a file using commands like cat or by opening it in a text editor.

    • Directory: "Read" permission on a directory allows users to explore its treasures.

  2. Write (w) πŸ“:

    • File: Users with "write" permission can inscribe, edit, or erase the contents of a file.

    • Directory: "Write" permission on a directory empowers users to create, obliterate, or mold files within.

  3. Execute (x) πŸƒβ€β™‚οΈ:

    • File: For files, "execute" permission invites users to perform the file's programmed dance or script.

    • Directory: "Execute" permission on a directory is the key to unlock and traverse its mystical realms.

To wield the magic wand of permission changes in Linux, we invoke the chmod command. The basic incantation is as follows:

bashCopy codechmod permissions file_or_directory

Here, "permissions" can be expressed in different dialects:

  • Symbolic Representation: Weaves letters (u, g, o) with symbols (+, -, =) to add, subtract, or set permissions. For example:

      bashCopy codechmod u+rwx file.txt   # Adds read, write, and execute permissions for the owner
      chmod go-w file.txt    # Removes write permission for the group and others
      chmod a=r file.txt     # Sets read-only permission for all (owner, group, and others)
    
  • Numeric Representation: Unfurls permissions in numerical dance moves. Each digit corresponds to a user category (owner, group, others), crafting a harmonious permission combination. For example:

      bashCopy codechmod 744 file.txt   # Grants read, write, and execute to the owner, and read-only to group and others
      chmod 644 file.txt   # Bestows read and write to the owner, and read-only to group and others
    

With the spell of chmod, administrators orchestrate the symphony of access control, ensuring the security and grace of files and directories in the Linux kingdom. πŸŽΆπŸš€

Connect with me on LinkedInπŸ‘”πŸŒ:https://www.linkedin.com/in/nikhil-kathale-27544a1b5/

12
Subscribe to my newsletter

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

Written by

Nikhil Kathale
Nikhil Kathale