linux file permissions and directory configuration

   The best thing about Linux is a multi-user, multi-tasking environment. In order to allow each user to have more confidential file data, the file permissions become very important.

  Summary of key points:

    1. Linux generally divides the identities that can access files into three categories: owner (owner), group (user group), and other (other users).

    2. The three user identities of owner, group and other have corresponding three permissions: read ("r" can be read), write ("w" can be written), execute ("x" can be executed)

  1. To understand user permissions, you need to understand the definitions of basic users and user groups:

    1. owner: For example, you have the habit of writing a secret love note, so this document does not want to be known. At this time, you can set the file so that only the owner of the file has permission to view and modify the content of the file , even if someone knows about this file, others cannot access it because of the permissions set.

    2. group (user group): For example, there are two competing groups on the same host. The members of the same group share data and assist each other, but they must not allow another group to see your labor results and changes. How to deal with that? That is to set permissions for members of each group, but if you have your own private files, you can still set them.

    3. other (other people): It is a special owner, that is, someone wants to use your computer to browse the web or something, but does not want others to know some secrets in your computer, then this other person can solve it perfectly

  Special permissions, root: all secrets are hidden in front of him.

    4. The file of Linux user identity and user group record: By default, all account and general identity user and root related information on the system are recorded in the /etc/passwd file. Personal passwords are recorded in the file /etc/shadow. All files for user groups are placed in the /etc/group file. These three files can be said to be recorded in the account, password, and user group information in the Linux system. Please do not delete them at will.

  2. Linux file permissions

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324838490&siteId=291194637