in reply to Re: Perl script needs root privilegies
in thread Perl script needs root privilegies
nobody: ALL=(ALL) NOPASSWD:/sbin/iptables
Eek! Now all of the CGI scripts, mod_perl code and everything else that runs anonymously under the web server, PLUS everything else that runs under user nobody on the system, including things like a font server, will be able to run this command!
The best approach in my opinion is to combine both:
But if I had to choose and use only one approach, I'd pick the OP's.
Now as to how to make the script setuid in the first place, that depends. If you have an operating system like Solaris that has secure setuid scripts, it will work directly. Otherwise you have the suidperl can of worms. As an alternative, the web server might make use of suExec and you may be able to get that to cause your script to run under the correct user ID.
In any case, don't forget to turn on taint checks if they're not turned on automatically for whatever invocation style you end up using (they are turned on automatically for true setuid scripts.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl script needs root privilegies
by tirwhan (Abbot) on Dec 27, 2005 at 19:51 UTC | |
by Celada (Monk) on Dec 30, 2005 at 06:18 UTC |