I have a few commands I need to invoke from my PHP web application that can only run as sudo
.
http://php.net/manual/en/function.shell-exec.php says (in the comments) that I can do the following:
system('echo <password> | sudo -u root -S <command>');
It doesn't work. I'm trying to do a groupadd
, useradd
, etc. Suggestions?