Rights Management
File permissions:
There are three types of user access to files:
r,w, x read, write, execute
Directory permissions (here the X permission and file are a bit different to note):
r: you can use the LS command to list files or subdirectories in a directory; Note: If only R permissions do not have x permissions, the files and subdirectories in that directory cannot be listed
W: You can create or delete files in this directory;
x : You can use ' ls-l ' to list the detailed property information of directory files and subdirectories; You can use the CD command to switch the working directory to the specified directory; simply, without x permission, you can't get to this directory
The permissions for a file are defined primarily for three types of objects:
Ownuer:u, owner;
Group:g, The genus Group;
Other:o, Other;
Tips , just remember R =4 w=2 X=1 can be, 421, there are suid,sgid, Sticky bit, just also 4 2 1 This order, so very good memory, also need to note, when the file or directory does not have X permission when suid, SGID and Sticky Bit flags S and T will become uppercase S, T, equal to this permission does not work
Rights Management:
Rights Management: Chmod
Affiliation Management: Chown, Chgrp
file Matte code: Umask
Modify file permissions: chmod
chmod [OPTION] ... Mode[,mode] ... FILE ...
chmod [OPTION] ... Octal-mode FILE ...
chmod [OPTION] ...--reference=rfilefile.
where the meaning of Ugoa:
U:owner
G:group
O:other
A:all
There are two ways to modify permissions:
One: =mode such as =rx, =r, = (Nothing on the back is written on behalf of what permissions are not)
ug=rx,go=
Two: [+|-]mode for example U+r,
chmod +w file or dir name
chmod u+r file or dir name
-r:recursive Recursive
modified file owner: Chown
chown [OPTION] ... [OWNER] [: [GROUP]] FILE ...
Chown[option] ...--reference=rfile FILE ...
-r:recursive Recursive
Example: chown root:root filename
chown root filename If you enter only one property, the default is owner
chown:root filename a colon plus a property that represents a group of changes
modified file group: Chgrp
Example: chgrp groupname filename
umask : Mask code (for the initial file, directory permissions settings, in reverse form, file, directory maximum permissions minus umask is the right to get, root default umask is 0022, ordinary user is 0002)
directory equals: 777-umask
file equals: 666-umask
CentOS in the system, the file default is not execute permission, if a certain type of user's permission to reduce the result has EXECUTE permission, this time will automatically let its permission bit plus 1;
Umaskumask
Set: Valid only for the current shell process;
Linux Learning Path-management of permissions