Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

linux-acl-guide

Linux ACL Management

This guide explains how to manage file and directory permissions using Access Control Lists (ACL) in Linux. It includes examples of basic file operations, ACL modifications, and recursive permission management.

Table of Contents

1.Commands Overview

2.Viewing ACL Permissions

3.Modifying ACL for user and group

4.Modifying Other Permissions

5.Adding Multiple ACL Rules

6.Setting Mask Permissions

7.Recursive Permissions for a Directory

8.Removing ACL for a User

9.Resetting All ACL Permissions

10.Setting Default ACL for a Directory

1.Commands Overview

  1. View ACL of a file

    getfacl <file>
  2. Grant permissions

    setfacl -m u:<user>:<permissions> <file>
  3. Remove permissions

    setfacl -x u:<user> <file>
  4. Reset all ACLs

    setfacl -b <file>
  5. Recursive ACL for directories

    setfacl -Rm u:<user>:<permissions> <directory>
  6. Set default ACL for directories

    setfacl -m d:u:<user>:<permissions> <directory>

Examples

2.Viewing ACL Permissions

Displays the Access Control List (ACL) of the file f1.

Screenshot from 2024-12-04 22-20-54

3.Modifying ACL For User and Group

For a User:

Screenshot from 2024-12-04 22-22-54

Grants read-only (r) permission to user tom.

For Group:

Screenshot from 2024-12-04 22-29-21

Grants read, write, execute (rwx) permissions to group A1.

4.Modifying other Permissions

Screenshot from 2024-12-04 22-30-33

Grants write-only (w) permission to others.

5.Adding Multiple ACL Rules

Screenshot from 2024-12-04 22-34-48

Adds the following: User varun gets rw (read, write) permissions. Group B1 gets rx (read, execute) permissions. User jack gets rwx (read, write, execute) permissions.

6.Setting Mask Permissions

Screenshot from 2024-12-04 22-36-55

Sets the mask to read-only (r), which limits the effective permissions for group and other ACL entries.

7.Recursive Permissions for Directory

Screenshot from 2024-12-04 22-45-58

both have different permission but when we use -R recursive then

Screenshot from 2024-12-04 22-49-51

Recursively grants write permission to user tom for the directory abc and all its contents (like f2).

8.Removing ACL for a User

Screenshot from 2024-12-04 22-54-10

Removes the ACL entry for user varun.

9.Resetting All ACL Permissions

Screenshot from 2024-12-04 22-55-18

Removes all ACL entries from file f1.

10.Setting Default ACL for a Directory

Screenshot from 2024-12-04 23-01-30

Sets a default ACL for user don with rwx permissions. Any new file created inside abc will inherit these default permissions.

Notes

  • Use ls -l to identify ACL-enabled files (+ sign).

Screenshot from 2024-12-04 23-02-52

  • Use mask to limit the maximum effective permissions for ACL entries.

Author

This guide was created to assist with Linux ACL management and improve understanding of permission settings.

About

This guide explains how to manage file and directory permissions using Access Control Lists (ACL) in Linux. It includes examples of basic file operations, ACL modifications, and recursive permission managemen

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors