In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article to share with you is about Linux system file attributes in the user and group and permissions are what, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.
Linux system file attributes of users, groups, permissions
Linux users are divided into roles, the user's role is identified by UID and GID (that is, the system is identified by the user's UID, GID, rather than the user's user name), a UID is unique (unique in the system like ID card) used to identify the system user account (user name).
File users and user groups
1. The UID=0,GID=0 of the super administrator. It can also be said that as long as the system recognizes that the UID\GID of a certain user is 0, the system considers this user to be a super administrator.
2. Ordinary user (added by administrator), its UID\GID is from 500-65535 by default, and its permissions are very small, and it can only operate files and subdirectories in its own home directory (Note: nobody its UID\GID is 65534)
3. System users are also called virtual users, that is, they exist by default when installing the system and cannot log in to the system. Their UID\GID is 1-499.
cat /etc/passwd can display all user information of the system, column 3--UID column 4--GID
As mentioned earlier, file system permissions are a problem. Next, let's talk about file system permissions.
rw-------. 1 root root 1660 Aug 7 18:01 anaconda-ks.cfg
This rw-----represents the permission information of this file. Three digits are a group, which are user permissions (file owner), group permissions, and permissions of other users.
1. Permission for ordinary files
1, r Read file content
2. w Add and modify file contents, but the permission to delete is controlled by the permission of the parent directory and has nothing to do with the permission of the file itself.
Figure can be seen that other users have read and write permissions to this file, test whether you can delete this file
From this, we can see that it is not possible to delete files with write permission to them.
3. X execution permission (the file itself should be executable and the ordinary user should have the read permission of the file, and the root user can execute without the read permission), executable file: *.sh/*.py/*.perl, etc.
II: Directory permissions
1, r browse directory permissions (directory files and subordinate directories, etc.) but can not enter the directory, the same can not see the contents of the directory files
2. w Permission to delete or modify files in the directory (generally referring to file names), but X permission is required.
Other users have read and write permissions to the directory
Change file name prompt insufficient permissions, but can see the file content
Remove read permissions and add X permissions.
Successful renaming means that X permission is indeed required to be used in conjunction with W permission.
3. x indicates permission to enter the directory
Therefore, when users only have X permissions on directories, they can only enter the corresponding directories and cannot read or write the contents of directories and files below them.
The above is what users and groups and permissions are in the Linux system file attributes. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please 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.