LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 688|回复: 4

setUID problem

[复制链接]
发表于 2005-3-6 15:10:20 | 显示全部楼层 |阅读模式
As I just want to test the function of setUID , i wrote a script named "test.sh" following with root:

#!/bin/bash
mkdir /root/Test

setUID: chmod +x test.sh
the mode of the file now
   -rwsr-x-r-x
it will do the trick when i use it with root but failed with the other user.
Display
"Creating /root/Test Pemission Deny"
What the matter??? Why???
I puzzled.
:help
发表于 2005-3-7 13:09:43 | 显示全部楼层
脚本设置成setuid 不是这么搞的. 具体怎么的,我也不记得了.:-(
回复 支持 反对

使用道具 举报

发表于 2005-3-7 14:23:35 | 显示全部楼层
Post by 弥敦路九号
脚本设置成setuid 不是这么搞的. 具体怎么的,我也不记得了.:-(


兄弟能找找资料说下如何才能让setuid的脚本可用吗?

我一直以为是像楼主那样做.请指点

另外,脚本setuid是很危险的其中缘由可参看下面这个链接:
http://fanqiang.chinaunix.net/a4/b1/20010419/105032.html
回复 支持 反对

使用道具 举报

发表于 2005-3-7 23:13:04 | 显示全部楼层
Linux doesn't support this since it is insecure.  It works with perl
scripts only, because Perl does some extra checks and explicit handling to
make it work.

To get a setuid shell script you have to write a C wrapper program for it
or let the user execute it with sudo.
回复 支持 反对

使用道具 举报

发表于 2005-3-7 23:39:47 | 显示全部楼层
Post by 弥敦路九号
Linux doesn't support this since it is insecure.  It works with perl
scripts only, because Perl does some extra checks and explicit handling to
make it work.

To get a setuid shell script you have to write a C wrapper program for it
or let the user execute it with sudo.

呵呵,和我找到的资料说法是一样的,在Linux这样和系统setuid是不起作用的,但在一些UNIX系统则可以起作用,此时要非常注意安全
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表