[fpc-pascal] shell script with root rights and automatic password

Michael Van Canneyt michael at freepascal.org
Sun Dec 6 18:13:23 CET 2015



On Sun, 6 Dec 2015, Rainer Stratmann wrote:

> How to do this?
>
> I would like to run a script with root rights from an application.
> The password should be transferred automatically.

As far as I know, this cannot be done except by making the application itself setuid root.
If you create a setuid script, it will nevertheless execute with the rights of the invoking user.

I use a very small program which is setuid root, which I supply with the name of  a script and the 
arguments to feed to the script. The name of the script must match one of a list.

Michael.



More information about the fpc-pascal mailing list