Re: su idn't working from within php
| From: | Marek Kilimajer | Date: | Tue, 27 Jan 2004 15:22:56 +0000 |
| Subject: | Re: su idn't working from within php | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175924@lists.php.net to get a copy of this message | ||
You need to edit /etc/sudoers file and allow apache to execute <command>. And you also need to be carefull what you are doing or you will create a security hole.
Nitin Mehta wrote:
but how would i store keys for apache? ----- Original Message ----- From: "Marek Kilimajer" <kilimajer@webglobe.sk> To: "Nitin Mehta" <nitinmehta@kappa.net.in> Cc: <php-general@lists.php.net> Sent: Tuesday, January 27, 2004 4:03 PM Subject: Re: [PHP] su idn't working from within phpWhy do you need su? Set up sudo for apache user. Nitin Mehta wrote:my php script withhi all i was trying to execute some commands as an authorized user from withingenerated with keygen, as the scripts are run as apache/http user..........exec ("su <username> -c \"sudo <command>\" 2>&1;", $output); but it gives me standard in must be a tty how can i make it work? it runs perfectly at command prompt I even tried to ssh, but the problem is where should i copy the rsa-keyPlz help me out of this Thanx in advance Nitin-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php