Day 6 Task: File Permissions and Access Control Lists
"Securing Access: A Guide to File Permissions and Access Control in Linux"
Here I am creating a simple file and ls -l , ls -lt ,ls -ltr to see the details of the file where we ca see the file permissions nothing but which file can read, write and execute.
Here's a shorter explanation:
ls -l
: Shows a detailed, long-format listing of files and directories.ls -ltr
: Displays a long listing, sorted by modification time in reverse order (oldest first).ls -lt
: Provides a long listing, sorted by modification time with the newest files first.
These are commands used in Linux-like operating systems for managing file and directory permissions
chown
Stands for "change owner." It is used to change the owner of a file or directory. For example:
syntax: chown username:groupname file.txt
chgrp
Stands for "change group." It is used to change the group ownership of a file or directory. For example:
syntax : chgrp groupname file.txt
chmod
Stands for "change mode." It is used to change the permissions (read, write, execute) of a file or directory. Permissions are set for three entities: owner, group, and others. For example:
syntax: chmod 755 file.txt
ACL Access Control List
An Access Control List (ACL) is a set of permissions associated with a file or directory in a computer system. ACLs define which users or system processes are granted access to objects, as well as what operations are allowed on given objects.
Below in the image I have used getfacl and setfacl i.e
1.getfacl
syntax : getfacl filename
Retrieves Access Control List (ACL) information for a file or directory.
2.setfacl
Sets or modifies ACL for a file or directory.
syntax : setfacl options filename
user- setfacl -m u:username:rwx filename
group- setfacl -m g:groupname:rwx filename
remove all entry - setfacl -b filename
remove specific entry- setfacl -x u:username:rwx filename
THANK YOU FOR READING!