In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What are the Linux permissions? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
Before we understand permissions, we need to know the user groups in linux:
In Linux, each user belongs to a group, and every file in Linux has an owner, all groups, and other groups. We can use real examples to understand these concepts. For example, if you have a book, then you are the owner of the book, you have the maximum authority for this book, you can use it, lend it, give it other permissions, and other students in your class and you can be regarded as a group, and students in other classes can be regarded as students in different groups. Now that you have the maximum authority for this book, you can also share this book with your classmates, so that you have the same authority, and other students in your class can also modify the authority of this book. at this time, this book becomes a book shared by your class, and everyone in your class has the same authority.
At the same time, there is a root user in Linux who has the highest privileges and has higher privileges than any other user, so he can modify the permissions of any other file.
Permissions for the file:
We can use the command ls-l to view the detailed permissions of the file.
R: indicates readable
W: means writable
X: indicates executable
You can also use numbers to indicate this. We will modify the file permission description.
For the rwx of a folder, it means:
R means readable and viewable folder contents can be viewed by ls
W means writable and can transfer contents such as files to a folder
X means executable and can be cd into the folder.
Modification of permissions:
You can modify the permissions of a file with chmod in Linux
Rwx in Linux can also be represented by numbers
Rene4
White2
Xero1
It's easy to understand when these are converted to binary: 4: 0000 0100.
2 0000 0010
1 0000 0001
So this is the usual way to modify file permissions:
7 / 4 / 2 / 1 and grant rwx permissions to owners, groups, other users
Let's take a look at the user's permissions:
As shown in the picture, I created a test.txt file using my hja account and the file permission is the owner rw
Rw, a member of the group
Other group members do not have any permissions
Now let's switch between hhh accounts:
You can see that the permissions are insufficient, because hhh belongs to another group, so there is no read permission and no delete permission.
Paste Linux as (sticky bit):
To delete a file, you do not necessarily have write access to the file, but you must have write access to the parent directory, that is, even if you do not have write access to the file, you can also delete the file if you have write access to the parent directory. The function of the sticky bit is to enable a directory to allow any user to write to a file but not to allow other users to delete the file.
Thank you for reading! After reading the above, do you have a general understanding of Linux permissions? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.