7.Linux permission Extensions
· default permissions, Each terminal uses a umask property to determine the default permissions for the new file directory.
· umask The default permission for a directory is to use the Digital permission method, 777-umask , the default permissions for the file are, 666-umask ,
• In general, the default umask for ordinary users is 002, andtheroot user's default Umsk is 022 ,
• That is, for normal users, the new file is 666-002=664, and the new directory permission is 777-002=775,
• View umask values,umask or umask-s,
• Set umask values, such as:umask 002
• Special Privileges , in addition to normal permissions, there are three special permissions:
• Only executable binaries can be set suid,sgid,sgid can also be used for directories,
· suid , the settings are allowed to execute as the file's owning user, not the current user, without affecting the directory, such as passwd ,
· Sgid , executed as the owning group of the file, and the new file created in the directory inherits the group to which the directory belongs, as Locate ,
· Sticky , users with write access to the directory can delete only the files they own and cannot delete files owned by other users .
• Set suid,chmod u+s test, user must have execute x permission on file , use cautiously, s is an error,s is correct,
• Set sgid,chmod g+s test,
• Set sticky,chmod o+t test,
• As with normal permissions, special permissions can also be represented by digital means,suid=4,sgid=2,sticky=1,
• So you can order such as:chmod 4755 test,
7.Linux Permission Extensions