A much better option than suid-ing a script IMO is to use sudo to give your user exactly the capabilities he needs. For example, if you put this in your /etc/sudoers file:
nobody: ALL=(ALL) NOPASSWD:/sbin/iptablesYour user nobody will be able to call sudo iptables and it will execute as root without the need to enter a password. Personally this would not be quite paranoid enough for me, I'd prefer to write separate shell scripts which execute exactly the iptables command I want the user to be able to execute and specify these explicitly in sudoers, but YMMV.
In reply to Re: Perl script needs root privilegies
by tirwhan
in thread Perl script needs root privilegies
by ivanatora
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |