原文:http://www.techcuriosity.com/resources/linux/advanced_file_permissions_in_linux.php
Here we will discuss about the 3 special attributes other than the common read/write/execute.
Example:
drwxrwxrwt - Sticky Bits - chmod 1777
drwsrwxrwx - SUID set - chmod 4777
drwxrwsrwx - SGID set - chmod 2777
Sticky bit | |
| Sticky bits are mainly set on directories. Example: Example: ls -al From the above example a1 is the owner of the test directory. | |
SUID - [ Set User ID ] | |
| SUID bit is set for files ( mainly for scripts ). Example: Note: | |
SGID - [ Set Group ID ] | |
| If a file is SGID, it will run with the privileges of the files group owner, instead of the privileges of the person running the program. You can also set SGID for directories. Example: In the above example you can see that the owner of the file 1.txt is b2 and the group owner is a1. Now lets make this more intresting and complicated. Example: ls -al test From the above permission set you can understand that SGID and sticky bit is set for the folder "test". Example: So all the a1 user has access to all the files under the test directory. He can edit, rename or remove the file. If sticky bit was not set for the test directory, any user can delete any files from the test directory, since the test directory has 777 permissions. Example: | |
Linux特殊权限详解
本文深入探讨了Linux系统中三种特殊的文件权限设置:粘滞位(Sticky Bit)、设置用户ID(SUID)和设置组ID(SGID)。通过具体实例说明了这些权限如何影响目录和文件的操作,并解释了它们对于系统安全的重要性。
311

被折叠的 条评论
为什么被折叠?



