Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to View or Change ACL in Linux Files

    How to View or Change ACL in Linux Files

    RahulBy RahulMarch 12, 20131 Min ReadUpdated:April 26, 2022

    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
    Previous ArticleWhat is inode number in Linux ?
    Next Article All about Linux shell

    Related Posts

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    Updated:May 10, 20221 Min Read

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Enable SSH Server on Ubuntu 22.04

    Updated:April 22, 20222 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    10 Best Linux Video Players in 2022

    Updated:February 18, 20226 Mins Read

    How to Switch Python Version in Ubuntu & Debian

    Updated:April 22, 20223 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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