Originally Posted by mohrct
The way I'm doing it now is with sudo...I did something like this:
chris ALL=(root) NOPASSWD: ALL
you can restrict the user chris to only execute your program as root with the following line instead of yours.
chris ALL=NOPASSWD: /path/to/your/program
you could also use the suid flag.
chown root /path/to/your/program && chmod u+s /path/to/your/program.
In both cases you should not need 'sudo' in your commands. With the setuid method, all users will be able to execute your program as root while the sudoers method restricts that to user chris.