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
As a commonly used database, MySQL requires a lot...
ClickHouse is an open source column-oriented DBMS...
Table of contents 1. Download nodejs 2. Double-cl...
Mac node delete and reinstall delete node -v sudo...
JavaScript clothing album switching effect (simil...
When you use the docker command for the first tim...
Table of contents Local Mixin Global Mixins Summa...
1. Query process show processlist 2. Query the co...
Table of contents 1. Node.js and Vue 2. Run the f...
Sample code: import java.util.Random; import java...
We all know that Jmeter provides native result vi...
Preface 1. The tools used in this article can be ...
The mysql service is started, but the connection ...
Table of contents I. Definition 2. Usage scenario...
Table of contents 1. mysqldump command to back up...