Linux File Permissions and Access Control Lists.

In Linux, every file and directory has three types of permissions:
Read (r) - The ability to view the contents of the file or directory.
Write (w) - The ability to modify the contents of the file or directory.
Execute (x) - The ability to execute the file or access the contents of the directory.

These permissions are assigned to three categories of users:
Owner - The user who created the file or directory.
Group - A group of users who share a common set of permissions.
Others - Any user who is not the owner or a member of the group.

Let's understand it with the below example:
- Create a simple file and do
ls -ltrto see the details of the files:
$touch demofile.txt
$ls -ltr

- Now, will change the file permission for demofile.txt using "chmod" and verify using ls -ltr
$chmod 700 demofile.txt (read write execute permission for user)
$ls -ltr

Access Control Lists:
Access Control List (ACL) is a mechanism used in Linux and other operating systems to provide additional permissions beyond the traditional owner, group, and other permissions. ACLs allows us to set permissions for individual users or groups of users on a file or directory.
ACLs are useful when we need to grant specific permissions to a subset of users or groups that are not covered by the traditional permissions. For example, we may want to give a specific user read and write permissions to a file, while denying those permissions to all other users.
Let's view the ACL entries for a file using "getfacl"
$getfacl demofile.txt
$setfacl -m u:username:rw demofile.txt





