我的Debian中有个目录的权限是drwx-wx-wt,请问最后的t是什么意思
发布网友
发布时间:2022-05-05 15:18
我来回答
共1个回答
热心网友
时间:2023-10-08 21:19
Directory Permissions
There are two special bits in the permissions field of directories. They are:
s - Set group ID
t - Save text attribute (sticky bit) - The user may delete or modify only those files in the directory that they own or have write permission for.
Save text attribute
The /tmp directory is typically world-writable and looks like this in a listing:
drwxrwxrwt 13 root root 4096 Apr 15 08:05 tmp
Everyone can read, write, and access the directory. The "t'' indicates that only the user (and root, of course) that created a file in this directory can delete that file.
To set the sticky bit in a directory, do the following:
chmod +t data
This option should be used carefully. A possible alternative to this is
Create a directory in the user's home directory to which he or she can write temporary files.
Set the TMPDIR environment variable using each user's login script.
Programs using the tempnam(3) function will look for the TMPDIR variable and use it, instead of writing to the /tmp directory.
参考资料:http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html