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
Uses of new The function of new is to create an i...
The default port number of the Windows server rem...
In the previous article "MySQL table structu...
I searched online and found that many interviews ...
After setting up the MySQL master-slave, you ofte...
I worked in operations and maintenance for two ye...
Use native JavaScript to simply implement the cou...
You may sometimes need to create or delete symbol...
When configuring proxy_pass in nginx, if you matc...
1. Log in to MySQL database mysql -u root -p View...
Since Alibaba Cloud's import of custom Ubuntu...
Table of contents The dynamic particle effects ar...
Table of contents question analyze solve Replace ...
When we are writing projects, we often encounter ...
Preface This article introduces the fifth questio...