Re: Execute command line as a different user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matt Palermo wrote:
I'm using the following command and I'm not getting any feedback:

exec("echo 'adminPass' | sudo -u adminAccount -S whoami", $f, $r);

Both $f and $r don't contain any data. This leads me to believe that the command is not being run for whatever reason. Is there something wrong with this command? Is there a different way to do it?

set up sudo to run that particular command for that particular user with no password.

adminAccount	ALL = NOPASSWD: /usr/bin/whoami


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux