Re: Re: exec returns no output?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* and then Colin Guthrie declared....
> Nick Wilson wrote:
> > Right, im with you. The keyfile is mine though, and i know i can ssh
> > from this box to that without any problem. 
> > 
> > I've made a test script for htis and it's returning some very weird
> > stuff now. The actual file it outputs (stdout and stderr) is the actual
> > image im trying to send!
> > 
> > <?php
> >     $file = '/stat/data/drupal/image.png';
> >     exec("/usr/bin/scp -v -i /home/troot/.ssh/id_dsa $file nick@xxxxxxxxxxxxxxxx:/var/www/images/ 1>&2
> > /var/www/html/test/out", $ack);
> >     print_r($ack);
> > ?>
> 
> Could it be a permissions problem? your ~/.ssh folder should has to be
> nailed now permissions wise otherwise SSH will complain. Also the id_dsa
> file is usually only readable by the user and nothing else (e.g. mode 0600)
> 
> I'd suggest you check permissions. Also I'd add a new key for this
> rather than user your own. If the apache process can read your private
> key this is quite a security risk....

I think you're on the right track Col. I did a whole bunch more
searching and the one thing I kept hearing was that no matter what you
try, you just cant get the webserver to exec the script as another user
-- so even if im saying 'nick@server' in both parts of the scp command,
it's still being exec'd as apache, and apache has no home, and no .ssh
dir.

i've tried putting the perms on that dsa file directly as the apache
user and even putting it eleshwere in teh filesystem but nothing seems
to work

As i dont have the ssh2 ext on this setup, and have no desire to go
messin with new extensions it looks like im going to have to go gthe nfs
route on this problem unless anyone has done this before and knows an
answer?

thanks for the help!


-- 
Nick Wilson
http://performancing.com/user/1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux