File permissions In addition to R, W, X also have S, T, I, a permission:
S: The file owner and group set the SUID and GUID, and the file will be executed as root after the S permission has been set. When setting the S permission, the file belongs to the main, the group must first set the corresponding X permission, otherwise the S permission does not take effect (c h m o d command does not perform the necessary integrity checks, even if you do not set the X permission to set the S permission, chmod will not error, when we ls-l see RWS, capital S description s permission is not effective Linux Change Password passwd is a set of SUID programs, ordinary users do not read and write/etc/shadow file permissions can modify their own password.
ls-al/usr/bin/passwd
-RWsr-xr-x 1 root root 32988 2008-12-08 17:17/usr/bin/passwd
We can set the S permission through the character mode: chmod a+s filename, or it can be set using absolute mode:
Set S u i d: set the corresponding permission bit to the previous one to 4;
Set g u i d: set the corresponding permission bit to the previous one to 2;
Both sets the position: the one before the corresponding permission bit is set to 4+2=6.
Example: chmod 4764 filename//settings suid
T: Set the sticky bit, a file can read and write users and must let him have permission to delete this file, if the file set the T permission to use only the owner and root to delete the file permissions, through chmod +t filename to set t permissions.
I: Non-modifiable permission example: chattr u+i filename The filename file is not modifiable, regardless of anyone, if need to modify the need to remove the I permission, with chattr-i filename. See if the file has the I permission set with lsattr filename.
A: Only append permissions, for the log system is very useful, this permission so that the target file can only append, cannot delete, and cannot be appended through the editor. You can use Chattr +a to set append permissions.
This article is from the "Tao Sound Still" blog, please make sure to keep this source http://zhaoyongtao.blog.51cto.com/10955972/1760146
Linux special permissions S, T, I, a