[TriLUG] SUID question
Adrian Likins
alikins at redhat.com
Thu Sep 12 16:44:31 EDT 2002
On Thu, Sep 12, 2002 at 04:34:24PM -0400, Richard O. Hammer wrote:
> I seem to be missing something basic about the way SUID
> works. I can't give my ordinary users the powers of root in
> executable files.
>
> In the session which I copy below, you can see that I have two
> shell scripts, named aOne and aTwo, in a directory named
> /permissions. aOne can only be run by root. aTwo calls aOne.
>
> It seems to me that my ordinary user (named roh) should be
> able to execute aTwo and thus aOne, which is called from aTwo,
> because the SUID bit is set on aTwo (and the SGID bit is set
> too, in case that might help). But, as you can see, roh is
> denied permission to execute aOne from aTwo.
>
> I am running RedHat 7.3
>
> What am I overlooking?
>
Linux doesnt honor the suid bit on shell scipts. Executing
a SUID script as a user ignores the SUID bit and just execs it
as the user. The user "roh" doesnt have perms to execute "aOne"
so it fails with the permission denied error.
Adrian
> [root at r permissions]# su roh
> [roh at r permissions]$ ./aTwo
> /bin/bash: /root/.bashrc: Permission denied
> in a Two, trying aOne
> ./aTwo: ./aOne: /bin/bash: bad interpreter: Permission denied
More information about the TriLUG
mailing list