passing commands via ssh
| From: | Mignon Hunter | Date: | Wed, 09 Jul 2003 19:04:52 +0000 |
| Subject: | passing commands via ssh | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154617@lists.php.net to get a copy of this message | ||
Hello all,
I am trying to execute a command on another server from my web
application.
I need to execute the command via ssh for security reasons. I have a
private key/passphrase installed for ssh so that I can run ssh without a
password.
The command:
ssh -i vertex vertex@wolf TX 77041 COD 10000.00
Works from my box's command line. The vertex 'key' for ssh is also in
the same directory.
But when I run
system(ssh -i vertex vertex@wolf TX 77041 COD 10000.00)
from my script I get an error:
Host key verification failed.
Also, when including the return status var I get different values such
as: 255 or 127 or 1....But I do not know what these mean.
This may not be a php issue but a webserver issue - sorry but I have no
ideas at this point.
Do I need to look in to some other functions to facilitate this? I did
try passthru() and exec() with similar results.
Any help is as always greatly appreciated.
Thx
Mignon