[NTLUG:Discuss] SETUID on Shell Scripts Question

Bug Hunter bughuntr at one.ctelcom.net
Mon Apr 3 08:59:05 CDT 2000


  You have to do the suid on the program that execute, not just the shell
script.  I would run the script as root using a cron job, making it
readable and executable for root only.



On Mon, 3 Apr 2000, Mike Owens wrote:

> This is an embarassing question, but I evidently am not getting it. I
> have a simple shell script which I have setuid to root. All it does it
> take md5 sums on everything in /usr/bin. Yet when I run it as a plain
> old user, I get "permission denied" on the binaries which don't have
> group or user read permissions.
> 
> Why is the happening? If I run it as root---no problem. I thought suid
> was supposed to make it execute as root (assuming it is owned by root).
> I read in the bash man pages to use the -p switch as well. Still, no
> avail.
> 
> I guess my shell is executing the script, and thus using its uid and
> guid. How do I set permissions such that this won't happen?
> 
> Anyone?
> 
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
> 





More information about the Discuss mailing list