Re: Execute command line as a different user

From: Date: Tue, 01 Jul 2008 21:08:28 +0000
Subject: Re: Execute command line as a different user
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-276196@lists.php.net to get a copy of this message
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

« previous php.general (#276196) next »