Re: how to execute a remote command from php
| From: | John Nichel | Date: | Mon, 27 Sep 2004 16:49:23 +0000 |
| Subject: | Re: how to execute a remote command from php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197979@lists.php.net to get a copy of this message | ||
Victor Alvarez wrote:
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.Betcha php isn't running as 'victor', is it? And probably doesn't have permission to read /root/.ssh/id_dsa. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com