How to Manage Basic Linux Permissions for Beginners

How to Manage Basic Linux Permissions for Beginners

Last Blog Review

In the last, blog we learned about how permission’s play an important role in the Linux access management and one of the main permission control which is Access Control List that manages specific permission provided to the user for group.

Basic Permission in Linux →

In the earlier blog, we understood the permission using ACL. But the most commonly used permissions are the one which will be explained below.

  • To check the basic file permission we simply use command “ls -l“

      “ls -l /test.txt”
    
      O/p = -rw-r--r--. 1 root root 0 Jan 4 14:55 /test.txt
    

    The above command shows the permission which the file has like if it’s a directory or file, the permission for the user, group, and other user’s. If they have the read/write/execute permissions which we are looking for in this blog.

  • What does “drwxrwxrwx” symbolizes.

    d

    It represents file type. If it’s “d” then it shows the permission of the directory and if it’s a “-“ then it show’s the permission of the file.

    rwx

    r means to read the data in the directory or file.

    w means to write the data in the directory or file.

    x means to execute the data in the directory or file.

    User (1st rwx from left side) → It allows the user’s to read/write/execute data in file or directory.

    Group (2nd rwx from left side) → It allows the group to read/write/execute data in file or directory.

    Other User’s (3rd rwx from left side) → It allows the other user’s like external application to read/write/execute data in file or directory.

  • Permission Set

Access for a file

Read (r) → display the file contents and copy the file.

Write (w) → modify the file contents

Execute (x) → execute the file if it’s an executable.


Access for directory

Read (r) → View contents of a directory.

Write (w) → modify the contents of a directory.

Execute (x) → Allow use of cd commands to access the directory.

Conclusion →

So, we have learned about how basic permission’s have all the control on the read, write and execute on the file and the directory in the Linux. The “drwxrwxrwx” permission explains what are the controls on the particular file or directory and the changes that can be done by the user’s or groups.

💡
Loved this post? Share it with your friends! If you have any questions or thoughts, leave a comment below – I’m looking forward to hearing your perspective. Don’t forget to subscribe for more content delivered directly to you. Stay tuned for more tips, ideas, and inspiration coming soon!