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.
This permission set also can make a similar impact. Here the script runs under the groups ownership.
You can also set SGID for directories.
Consider you have given 2777 permission for a directory. Any files created by any users under this directory will come as follows.
Example:
-rw-rw-r-- 1 b2 a1 0 Jun 11 17:30 1.txt
In the above example you can see that the owner of the file 1.txt is b2 and the group owner is a1.
So both b2 and a1 will have access to the file 1.txt.
Now lets make this more intresting and complicated.
Create a directory "test". Chmod it to 2777. Add sticky bit to it.
Example:
mkdir test
chmod 2777 test
chmod +t test
ls -al test
drwxrwsrwt 2 a1 a1 4096 Jun 13 2008 test
From the above permission set you can understand that SGID and sticky bit is set for the folder "test".
Now any user can create files under the test directory.
Example:
drwxrwsrwt 2 a1 a1 4096 Jun 13 2008 .
-rw-rw-r-- 1 b2 a1 0 Jun 11 17:30 1.txt
-rw-rw-r-- 1 c3 a1 0 Jun 11 17:30 2.txt
-rw-rw-r-- 1 d4 a1 0 Jun 11 17:30 3.txt
So all the a1 user has access to all the files under the test directory. He can edit, rename or remove the file.
b2 user has access to 1.txt only, c3 has access to 2.txt only...
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.
But now it not possible.
Example:
If d4 tries to remove 1.txt
rm -f 1.txt
rm: cannot remove `1.txt': Operation not permitted
|
相关推荐
controlling special permissions, encrypting file systems, and much moreMaster the art of securing a Linux environment with this end-to-end practical guideBook Description This book has extensive ...
- **File System Management:** Understanding file permissions, managing directories, and working with different types of files and storage devices. - **User and Group Management:** Best practices for ...
Module 1 — Introduction to Linux Module 2 — Logging In and General Orientation Module 3 — Navigating the File System Module 4 — Managing Files Module 5 — File Permissions and Access...
In this chapter, readers are introduced to Fedora Linux, an advanced and powerful Linux distribution. The authors cover the basic concepts and features that make Fedora stand out as a leading choice ...
- [Advanced Linux File System Administration](https://www.linuxjournal.com/article/8395) - [Linux 文件系统权限详解](https://www.redhat.com/sysadmin/linux-permissions-explained) #### 14. 相关文档 - ...
Devices, Linux Filesystems, Filesystem Hierarchy Standard Shells, Scripting and Data Management User Interfaces and Desktops Administrative Tasks Essential System Services Networking Fundamentals ...
不同发行版使用不同的包管理器,如APT(Advanced Package Tool)用于Debian系发行版,YUM(Yellowdog Updater Modified)用于RHEL系发行版等。 #### 6. 用户空间(Userspace) 用户空间是指非内核空间,所有应用...
Advanced Encryption Standard (AES) 115 Message Authentication Codes 116 Summary 117 Chapter 7: Securing Application Data 119 Data storage decisions 120 Privacy 120 Data retention 121 Implementation ...
- **Advanced Features**: Advanced features like searching for files, previewing file contents, and managing permissions are explored. **Command-Line Interface (CLI)** - **Basics of Command Line**: ...
Using permissions in views 166 Summary 167 Chapter 9: Advanced Browsing and Searching 169 Adding RSS feeds 170 Creating the recent bookmarks feed 170 Customizing item fields 174 Creating the ...
- **Permissions and Ownership**: Detailed explanation of file permissions and ownership, including how to change them using commands like `chmod` and `chown`. #### Part V - Applications **Chapter 13...
Praise for Advanced Programming in the UNIX® Environment, Second Edition Praise for the First Edition Addison-Wesley Professional Computing Series Foreword Preface Introduction ...
- Configuring Ubuntu as a server for web hosting, file sharing, and other services. - Managing user accounts and permissions to control access to resources. ##### Multimedia - Playing and managing ...
You can also create your own policy files that define arbitrary permission sets. <br/>Comparison of the sample security policy file <br/> Permissions/Resource Setting Admin Default ...
以及如何定制生成的目标文件系统(Customizing the generated target filesystem),比如设置文件权限和所有权(Setting file permissions and ownership)、添加自定义设备节点(Adding custom device nodes)和...
- **NTFS and Unix File Permissions and Ownership**:增强了对NTFS和Unix文件权限和所有权的处理能力。 - **NTFS Compression**:支持NTFS压缩,提升了存储空间利用率。 - **Threaded Crash Protection**:通过...