Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to View or Change ACL in Linux Files

    How to View or Change ACL in Linux Files

    By RahulApril 26, 20221 Min Read

    The Ext3 and Ext4 filesystem includes support of ACLs on files and directories. ACL provides more control permissions on file than standard three access categories (owner, group, and other ). Using ACL you can provide permission to a specific user or group to file.

    Before working on ACL make sure that ACL is enabled on the mounted file system. You can enable it during mounting the filesystem with the ACL option.

    Use the following command Check if ACL is enabled on the filesystem or not.

    sudo mount 
    
    Output
    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,noatime,acl)

    Enable ACL by remounting file system using following command.

    # mount -o remount,acl  /
    

    To enable ACL default on system bootup update following entry in /etc/fstab file.

    Configure ACL on File

    If we want that user Bob to have all permissions on a file. Use the following command.

    # setfacl -m u:Bob:rwx tecadmin.txt
    

    Details of parameters:

    setfacel:  is a command itself
     -m : is used to modify ACL.
      u : it denotes to assign permission to a user
    bob : a system user
    rwx : file permissions.
    tecadmin.txt: file on which bob will get access.
    

    Check ACL on File

    Use following command to check ACL configured on a file.

    # getfacl tecadmin.txt
    

    Output:

    # file: tecadmin.txt
    # owner: root
    # group: root
    user::rw-
    user:Bob:rwx
    group::r--
    mask::rwx
    other::r--
    

    Remove ACL from File

    If we don’t need the ACL in file, we can simply remove using following command.

    # setfacl -x u:Bob tecadmin.txt
    

    Access Control List in Linux How to use ACL in Linux
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Understanding the LD_LIBRARY_PATH Environment Variable

    The Beginner’s Guide to Building Your First RPM Package

    The Beginner’s Guide to Building Your First Debian Package

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Difference Between Full Virtualization vs Paravirtualization
    • Virtualization vs. Containerization: A Comparative Analysis
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.