# Day 6 Task: File Permissions and Access Control Lists

Today is more on Reading, Learning and Implementing File permissions.

### File Permissions:-

* Read (r) Read permission is used to access the file's contents.
    

* Write (w) Write permission allows you to modify or change the contents of a file.
    
* Execute (x) Execute permission allows you to execute the contents of a file.
    

### Access Control Lists:-

This type of situation is what Linux Access Control Lists (ACLs) were intended to resolve. ACLs **allow us to apply a more specific set of permissions to a file or directory without (necessarily) changing the base ownership and permissions**.

**The concept of Linux File permission and ownership is important in Linux. Here, we will be working on Linux permissions and ownership and will do tasks on both of them. Let us start with the Permissions.**

1. Create a simple file and do `ls -ltr` to see the details of the files.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680161506188/a2e1a1c3-e9fd-499d-ac69-7e69dc60b398.png align="center")
    

Each of the three permissions is assigned to three defined categories of users. The categories are:

* ```plaintext
     owner   —   The owner of the file or  application.
    ```
    
    * "chown" is used to change the ownership permission of a file or directory.
        
    * ```plaintext
         group   —   The group that owns the file or application.
        ```
        
    
    * "chgrp" is used to change the group permission of a file or directory.
        
    * ```plaintext
         others  —   All users with access to the system. (outised the users are in a group)
        ```
        
    * "chmod" is used to change the other user's permissions of a file or directory.
        
        Task:- As a task, change the user permissions of the file and note the changes after `ls -ltr`
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680162154424/01c4c248-e598-490f-839d-3467aead5274.png align="center")
        
        Here in the sample.txt, the user has only read, and write permission so we can add execute permission also let's see how it's easy.
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680162421243/76d44d81-22eb-4f05-9f3d-0c4b09724e69.png align="center")
        
        **getfacl** displays the comment header, base ACL (access control list) entries, and extended ACL entries, if there are any, for each file that is specified. It also resolves symbolic links. You can specify whether to display access, file default, or directory default. You can also change the default display format.
        
    * **setfacl** sets (replaces), modifies, or removes the access control list (ACL) to regular files and directories. It also updates and deletes ACL entries for each file and directory that was specified by *path*. If *path* was not specified, then file and directory names are read from standard input (stdin). In this case, the input should give one path name per line.
        
        I hope this blog has helped you all. Many more blogs are on the way for our DevOps Journey.
        
    * Thank you.
