[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do I allow users to run a single command as root?



Casper BodenCummins <bodec@Sherwood.co.uk> writes:

> What you need here is to set the setuid bit. Run this command as root:
> 
>    chmod +s filename

Not to be nasty, but this is generally a *REALLY BAD IDEA* unless you
know *exactly* what you are doing.  If "filename" was not designed with
extremely careful attention to the fact that it's going to be run suid
root, you can be opening up your system to all kinds of security
attacks, or accidental disasters by enabling suid root.

I'm talking about attention to things like explicitly setting the
PATH, checking and setting IFS, etc.  If it's a perl script, using the
"taint" checks helps, but you have to know enough perl to be able to
fix the problems it reports.

Don't do this.  Use sudo, super, or some equivalent.

[end preach mode]

--
Rob



Reply to: