Linux, permissions are very important, but I am relatively easy to mix, today to practice and summarize it
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f38.gif "alt=" I_f38.gif "/> basic commands and instructions
1, change the genus group: usermod-g new_group-g support_group User
2. Change file properties: Chown user:group text--> The colon can be changed to "." and only when the symbol is changed. Administrators use
CHGRP Group text-to-add parameter-R to change the files under the directory to belong to groups
3. Change file permissions: chmod # # # text
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f38.gif "alt=" i_f38.gif "/> analog user examples: Group and others as opposed to the leaf
[[email protected] test]$ ls-dl/test #在该目录下实验, the permission is 777drwxrwxrwx. 4 root root 4096 Feb 22:02/test[[email protected] test]$ ID leafuid=500 (leaf) gid=501 (leaf) groups=501 (leaf) #leaf组 For Leaf[[email protected] test]$ ID groupuid=507 (GROUP) gid=501 (leaf) groups=501 (leaf) #GROUP组为leaf [[email protected] tes t]$ ID otheruid=508 (Other) gid=508 (other), groups=508 (other) #OTHER组与其他不同
File permissions
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f38.gif "alt=" i_f38.gif "/> File r,w,x permissions
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt= " i_f42.gif "/> Delete: File Delete, rename, move, Creates a W permission for the parent directory, regardless of the permissions of the file itself
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" I_f42.gif "/>vi operation: when the file has R permission, VI in the visible content, only R or only W or only X, the three can be forced to modify and save (the file belongs to the main group changed), the owner can touch
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt= " I_f42.gif "/>touch: Only R or only W or only X , the owner can touch, the other person only w permission to touch, otherwise not touch
View: only R when three can see cat, head, tail, less and so on, only w or x, can not do those operations
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" I_f38.gif "/> file rxw combination permissions
Rx:u,g,o These two combinations are required to execute a non-binary script
rw: Normal Edit file (can see the previous file content and edit)
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f38.gif "alt=" i_f38.gif "/> Special Permissions S,t
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" i_f38.gif "/> file suid permissions s
for binary executables only;
When the program is executed by a user with SUID permission, the program owner's permission is supported during execution.
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" i_f38.gif "/> File Sgid permissions s
for binary executables only; force inheritance of parent directory's genus Group for catalog
When a user with Sgid permission executes a program, the program will receive the permission of the group that the program belongs to during execution;
Directory Permissions
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f38.gif "alt=" i_f38.gif "/> Directory r,w, X permissions
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" i_f42.gif "/> directory Read permissions: A separate Read permission cannot execute the LS command, and LS dir needs to have the R-x permission for this dir at the same time.
Directory Write permission: The light has write permission to do nothing. To create a file with-WX permissions
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt= " i_f42.gif "/> directory execution permissions: Light has x permission to enter the directory, CD dir can be
650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f42.gif "alt=" i_f38.gif "/> directory RXW combination permissions
Rx: The LS can be executed
WX: can create files
Summary of Linux permissions (not to be continued)