Ask a Question related to PHP Development, Design and Development.
-
Mignon Hunter #1
passing commands via ssh
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
Mignon Hunter Guest
-
ssi commands in DW
:confused; I'm a newbee trying to take over a Web site that just sort of grew over the years with sucession of developers. First, it works! ... -
Key commands
I have very much utilized InDesigns ability to customize key commands (mine pretty much mimic Quarks since I'm already familiar with them) but I... -
Passing commands into flash player
We would like to be able to Play, pause, stop, and pass variables into a flash movie from a .NET application. I think there are a few ways we can... -
Help with UNIX commands
I am researching some unix commands and I would like to know if someone knows where I can find them online. I just want to know what are they used... -
HELP! Passing from database to asp page allowing user input then passing to another database.
My big problem is I'm a newbie working with someone else's code.(See code below) What I want to do is for the records that have a purchase order... -
Jeff Harris #2
Re: [PHP] passing commands via ssh
On Jul 9, 2003, "Mignon Hunter" claimed that:
|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.
|
[snip]
|Any help is as always greatly appreciated.
|
|Thx
|Mignon
Do you have the private key/passphrase installed as a regular user or the
httpd user of the local machine on the remote machine?
PHP will run the scripts as the httpd user, not as the user who owns the
script.
<?php
$line = exec("/usr/bin/id");
print ("PHP runs as $line\n</pre>\n");
?>
Jeff
--
Registered Linux user #304026.
"lynx -source [url]http://jharris.rallycentral.us/jharris.asc[/url] | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
Jeff Harris Guest



Reply With Quote

