Re: exec returns no output?
| From: | Colin Guthrie | Date: | Sat, 30 Sep 2006 14:43:52 +0000 |
| Subject: | Re: exec returns no output? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242427@lists.php.net to get a copy of this message | ||
Nick Wilson wrote:
>> Do you use generated keys without a password for logging in? Otherwise exec()
>> is just going to sit there while the scp command waits for a password.
>
> Tha'ts exactly what i think it's doing. The -i specifies an identity
> file according to the man page for scp so i would have hoped that would
> take care of it (as i cant work out how to generate an identity for the
> apache user itself) but i guess it is doing exactly as you say..
Nick I think you are misunderstanding what Ray is asking.
scp (without the -i <keyfile> arg) will ask you for your SSH password.
BUT, the keyfile itself can be generated to have a password also!
On the SSH server as the user you want to scp from apache as, run
"ssh-keygen -t dsa" and it will generate a key file in the current users
~/.ssh/ folder named id_dsa and id_dsa.pub
As part of this generation, it will ask you for a password for the KEY,
this is NOT the SSH password. If you want to run SCP without any
passwords, you need to just hit return at the password prompt so that it
will generate the keys without a password.
You will want to put the id_dsa.pub file on the web server and make it
readable by Apache.
Test it yourself as a normal user on the webserver and double check that
it doesn't require a password.
Hope that helps
Col.