Re: how to execute a remote command from php [done]
| From: | Victor Alvarez | Date: | Tue, 28 Sep 2004 10:22:01 +0000 |
| Subject: | Re: how to execute a remote command from php [done] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198056@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Sethi, Samir (IDS DM&DS)" <samir_sethi@ml.com>
To: "Victor Alvarez" <victor@sentidocomun.es>
Sent: Monday, September 27, 2004 5:47 PM
Subject: RE: [PHP] how to execute a remote command from php
Exactly, I had to generate keys for nobody and now I am able to execute
remote commands.
Thank you so much.
Victor.
I think when you execute the command it is run as user nobody. You may
need to generate keys for the
nobody account and update the authorized keys on the remote system.
Samir.
-----Original Message-----
From: Victor Alvarez [mailto:victor@sentidocomun.es]
Sent: Monday, September 27, 2004 12:35 PM
To: php-general@lists.php.net
Subject: [PHP] how to execute a remote command from php
Hello,
Since last week I am trying to execute a remote machine command from
php without success. Since ssh ask for a password, I managed to use ssh
with dsa authentication so it's possible to call the remote command
without password and only with one line: ssh -l victor 192.168.129.211
-i /root/.ssh/id_dsa "whoami". It works perfectly from command line but
I have nothing if I try to do the same from php: exec("ssh -l victor
192.168.129.211 -i /root/.ssh/id_dsa \"whoami\"",$results); $results is
empty after the execution.
I wonder if somebody could answer this question. I have found no
solution googling it.
Thank you.
Regards,
Victor.
--------------------------------------------------------
If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here for important additional terms relating to
this e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------