On Mon, 6 Sep 2004, Chandu Nannapaneni wrote:
> I want to capture the output of a certain remote command ( issued
> thru a SSH session to a remote server) in PHP.
>
> The following code is working well when ran from the console
> Ex: php -q test.php
>
> <?
> passthru("/usr/bin/ssh -v -i /var/wwwhtml/sshtest/id_rsa
> [EMAIL PROTECTED] uptime");
> ?>
>
> But when called from apache .. It's not giving any ouput.
>
> [EMAIL PROTECTED] is well configured for ssh without passphrase
> I've checked the file permissions of /var/wwwhtml/sshtest/id_rsa
> It's given read permissions for the user 'apache' ( apache is running
> as apache:apache )
>
> Any hints ???

But have you tested this as user apache from the command line?

  su - apache
  /usr/bin/ssh -v -i /var/wwwhtml/sshtest/id_rsa [EMAIL PROTECTED] uptime

Chances are you will also need to add -o "BatchMode yes" to that ssh
command.

-Rasmus

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

Reply via email to