User Groups In Linux, every user must belong to a group, and there are three types of groups in Linux, as follows:
File Owner: User group: Other groups: How do we view the currently logged in user and the group to which the user belongs? Enter the terminal and enter the following command: 1. View the logged in user name? If you want to view the corresponding detailed information further, you can enter the following command: 1. cat /etc/passwd|grep loguser to capture detailed information of the user#The echo information is as follows: >>loguser: x : 889 : 600 : : /home/loguser:/bin/bash Username: Password: User ID: Group ID: Remarks: User home directory: The directory where the shell is located2. cat /etc/passwd|grep weblogic to capture detailed information of the user group weblogic: x:500:600::/weblogic:/bin/bash #The corresponding relationship is consistent with the user's relationship. Why do we talk about groups? In fact, it is closely related to the permissions discussed next. File permissions Every time we view the specific details of the files in the current directory through ll, we can see the following at the beginning of the file: drwxrwxrwx lrwxr-xrw- As shown in the figure, there are 10 digits in total. Excluding the first digit, the remaining 9 digits start from left to right, and every three letters represent a category. It seems that there are three groups in total, and the three categories here correspond to the user groups above: Remove the first letter:
The first digit represents the type of file:
Let's continue to discuss the meaning of the three letters rwx: r (Read): For files, it has the permission to read the file contents; for directories, it has the permission to browse the directory. The above rwx actually has the following corresponding relationship: Each letter corresponds to a number Students who have studied computer principles must be very familiar with 8421. In fact, this almost corresponds to this meaning. 1. Method 1 to modify permissions: chmod 755 abc 2. Method 2:
The above is a summary of the Linux user groups and permissions that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: JS object copying (deep copy and shallow copy)
>>: Mybatis+mysql uses stored procedures to generate serial number implementation code
Table of contents Preface cause Phenomenon why? A...
String functions Check the ascii code value of th...
MySQL is a relatively easy-to-use relational data...
Table of contents 1. Effect Demonstration 2. Impl...
For example: <link rel="stylesheet" h...
This article uses examples to explain the Nginx c...
We all know the drag-and-drop feature of HTML5, w...
1. Definition of offsetParent: offsetParent is th...
Table of contents 1. Component Organization 2. Co...
1. It is preferred to use the root user to log in...
prune To use this command, both the client and da...
Preface In the early stages of some projects, dev...
SQL Left Join, Right Join, Inner Join, and Natura...
Introduction MySQL achieves high availability of ...
When making forms, we often encounter the situati...