- https://unix.stackexchange.com/questions/503111/group-permissions-for-root-not-working-in-tmp/503169#503169
- https://bbs.archlinux.org/viewtopic.php?id=251217
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/sysctl/fs.txt?id=30aba6656f61ed44cba445a3c0d38b296fa9e8f5
问题表现
在/tmp 中 root 无法使用 tee -a 向别的用户文件追加内容
原因
Rocky 9 中 默认开启内核参数
此参数功能
- 此项保护机制的意图是避免程序在预期创建常规文件时,无意中向攻击者控制的FIFO(命名管道)进行写入操作。
具体场景如下
解决办法
- 你为什么要向别的用户的文件写入内容 ? Why not copy on write ?
- 如果实在有需求
1 | sysctl -w fs.protected_regular=0 |