“This is the 23rd day of my participation in the August Gwen Challenge.
The vast sea of millions, thank you for this second you see here. Hope my article is helpful to you!
May you keep your love and go to the mountains and seas in the coming days!
Linux advanced commands
Yesterday we have learned the Linux user management commands, know how to add users in Linux, delete users, switch users and other operations. Of course, our learning is more than this, today we on Linux file permissions management! Let ‘s GO!
Linux file permissions
Each user in Linux must belong to a group and cannot be independent of the group.
In Linux each file has a concept of owner, group, and other groups.
- Owner: The resource owner, also known as the owner, uses u to set permissions for the owner
- Owner group: Indicates the owner group (also called owner group). G is used to set permissions for group members
- Other groups: other groups other people, other users, using O identification, through O to set permissions for other people
- Use A for everyone (including the three categories of users above)
Setting permissions is to set file operation permissions for the three categories of personnel.
Permission to view resources
HHH: root HHH: root HHH: root HHH: root HHH: root
Parameter description:
Bit 0 identifies the file type (D, -, 1, C, b), and then the next few digits represent three permissions for each type of user.
Bits 1-3 determine that the owner (the owner of the file) has permissions on the file. -User
Bits 4-6 determine the permissions of the owning Group (the same user Group) to the file, -group
Bits 7-9 determine that Other users have permissions on the file –Other
RWX:
- R: read permission, read-only –> 4 can be used
- W: write permission, can edit files –> can use 2
- X: execute permission. Some files can be executed. If the file has execute permission, the file can be executed
Add permission syntax
Command:
Chmod User or Group + Permission Directory or file: Grants permissions to users or groups for specified files or directories. Multiple types of users are separated by commas
chmod g+w hhh
Copy the code
Delete permission syntax
Chmod User or group – Permission Directory or file: Grants permission to delete a specified file or directory to a user or group. Multiple types of users are separated by commas
chmod g-w hhh
Copy the code
Modify permission syntax
Chmod User or group = Permission Directory or file: Grants permission to a user or group on a specified file or directory. Multiple types of users are separated by commas
chmod g=rw hhh
Copy the code
Implement the demonstration
Using digital permission Settings:
conclusion
I believe that you are on the Linux system user file permissions management related commands have a certain understanding, looking forward to waiting for the next chapter in Linux advanced command process management learning!
Of course, there are more commands to watch next time! Welcome to the next chapter!
Let’s refuel together, too! I am not just, if there is any missing, wrong place, also welcome you to criticize in the comments of talent leaders! Of course, if this article is sure to help you a little, please kindly and lovely talent leaders to give a thumb-up, favorites, one key three even, thank you very much!
Here, the world is closed for today, good night! Although this article is over, I am still here, never finished. I will try to keep writing articles. The coming days are long, why fear the car yao ma slow!
Thank you all for seeing this! May you live up to your youth and have no regrets!