linux - setuid不生效

标签 linux setuid

假设用户A和B属于不同的组。而且他们中的 bot 不是 root

首先,作为用户 A。

1) touch a.txt; echo "hello word" > a.txt
2)chmod 600
3) touch b
4) echo "cat a.txt" > b
5) chmod 4755 b

然后切换到用户 B,我的假设是用户 B 可以成功运行二进制文件并获得问候语“hello word”,但是当我实际以用户 B 身份运行二进制文件时,我得到了“权限被拒绝”。所以为什么?

最佳答案

Linux 没有实现对脚本文件的S_ISUID 位的处理;相反,使用解释器(shell)的模式位。

关于linux - setuid不生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13816624/

相关文章:

linux - 使用 Tcpreplay 进行 UDP 调整

c - Linux 系统调用和 errno

linux - 困惑 : File ownership changed with setuid special permission flag

perl - 当用作 cgi-bin 时,如何使用 setuid() 成功运行 Perl 脚本?

Git post-receive hook 更新不同用户拥有的本地克隆

c - Linux套接字绑定(bind)连接

linux - 如何列出$PATH?

linux - 从内核的角度来看,linux 中的 GLI 和 CLI 有什么区别

gtk - 使用 GTK+ 的设置