May 4 at 4:25pm, Matt Babineau wrote:
> When I take the same string that I jsut used to scp the file and run it
> using exec, system, passthru it doesn't work!! I'm baffled and was
> hoping someone had successfully done this before.
>  
> $address = www.url.com;
> $value = "foldername";

I assume this is not your actual code, but you'll need quotes:
$address = "www.url.com";
  
>    if ($urlStatus == "Stopped") {
>     $cmd = "scp /home/dev.site.com/mail_admin/commands/remove
> ".$gs['address'].":/home/www/$value/command";
>     echo "&nbsp;&nbsp;".$cmd."<br>";
>     exec($cmd, $tmp, $rtmp);
>     print_r($tmp); echo $rtmp;
>     echo "<br><br>";
>    }

Looks like you're trying to execute the command:
scp /src/file www.url.com:/dest/file

I think you'll need to use:
scp /src/file [EMAIL PROTECTED]:/dest/file

However, it's highly likely (as Warren Vail alluded) that the web server 
is running as a different userid, therefore it would be as if another user 
executed the scp command, thereby not accessing your keys.

If that is the case, you may be able to set up a key for the webserver 
user to access the remote account.

An alternative would be to use the -i option to scp to specify the key
file (man ssh). In that case, it's likely that the webserver user would
need permissions to be able to read that key file.

Either solution could be a security issue, if you are on a shared server,
as it might allow other users to use that same key to access the remote
server as well. Proceed with caution!

> TIA for anyone who has done this and knows the answer!!!

Haven't done this, but I think it should work. Hope it helps at least.

-- 
Kelly Hallman
// Ultrafancy

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

Reply via email to