I discovered that there are many different ways to run a program as root.

The most well known way is to use the sudo command

$> sudo run_as_root_program.sh

This, of course, prompts for the password which you need to then enter.

But what if we need to run the program itself from another program so that the password prompt doesn’t appear?

I came across this requirement recently and it took quite a few iterations before I got it right.

Continue reading