Day 6 Task: File Permissions and Access Control Lists

Day 6 Task: File Permissions and Access Control Lists

#devops

Three types of Linux Permission classes

  1. User

  2. group

  3. other

  4. Default permission is -rw-rw-r

    chmod 777 file.txt

    chmod 640 file.txt

for the user can get access from the file called sudoers file

cat /etc/sudoers

root ALL = (ALL:ALL) ALL

(ALL: ALL) >> user and group

TASK:

  1. Create a simple file and do ls -ltr to see the details of the files

Each of the three permissions are assigned to three defined categories of users. The categories are:

  •      owner   —   The owner of the file or  application.
    
  • "chown" is used to change the ownership permission of a file or directory.

  •      group   —   The group that owns the file or application.
    
  • "chgrp" is used to change the gropu permission of a file or directory.

  •      others  —   All users with access to the system. (outised the users are in a group)
    
  • "chmod" is used to change the other user's permissions of a file or directory.

    1. change the user permissions of the file and note the changes after ls -ltr

getfacl and setfacl commands:

ACL: acl is used to show file permission in a flexible way.

getfacl :

setfacl :

setfacl sets (replaces), modifies, or removes the access control list (ACL) to regular files and directories. It also updates and deletes ACL entries for each file and directory that was specified by path.

setfacl -m u:ubuntu:rwx testingfile.txt

Thank you for reading this Blog. Hope you learned something new today! If you found this blog helpful, please like, share, and follow me for more blog posts like this in the future.

I would like to connect with you at linkedin.com/in/madhuri-patil-278b19118