So I'm currently trying to create a sudoers file, but I ran into something I can't figure out.
The end result I'm looking for is that I want users to be able to do something like:
sudo /usr/sbin/script.pl
But, instead of running as root, I'd like the script to run as "other_user".
I looked into the sudoers file, and I tried adding a line like:
pedro ALL = (other_user) /usr/sbin/script.pl
But that only works if I specify the user by doing sudo -u other_user /usr/sbin/script.
Is there an (easy) way to have the script run as a specific user, without having to specify it in the command line?
I guess the situation is that I personally don't care to use -u, but there are a bunch of scripts that would need to be picked through and modified, since instead of just replacing pfexec with sudo, every script would have to be modified to specify the particular user that is required for the different commands. :/
– Pedro Jun 21 '12 at 21:30