Re: Execute command line as a different user

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

 



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?

Thanks,

Matt


""Matt palermo"" <mpalermo@xxxxxx> wrote in message news:08.EE.06277.4C66A684@xxxxxxxxxxxxxxx
My PHP is running as a user with limited rights. I'd like to execute a command line as a different user. I'm trying to delete a file and the PHP user doesn't have access to do this. I know the username and password for the admin user that has rights to delete a file. Is there a command I can use to make PHP run a delete command as the admin user? If so, how can I do this?

Thanks,

Matt


--
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