NYCPHP Meetup

NYPHP.org

[nycphp-talk] (no subject)

wfan at encogent.com wfan at encogent.com
Thu Jul 15 12:42:06 EDT 2004


Hello Listies,

I am creating files with a PHP script. I want the script to 'scp' the
just-created file to a Windows box running a SSH/SCP server (WinSSHD)

The created files are owned by 'www'

I want to scp the files so that there is no prompt for a password --  as I
understand it, this is 'RSA Authentication'

I created a keypair using 'ssh-keygen -t dsa' and registered the public key
with the WinSSHD server.

Then, in the PHP script:

#####PHP#######
	$command = 'scp -q -B -i <PRIVATE_KEY> ' . $filename . '
<USER>@<IP_ADDY>:' . basename($filename);
	system( $command, $rc ); 
#####PHP#######

where:

<PRIVATE_KEY> is the private key of the keypair
$filename is the just-created file
<USER> is a Windows account
<IP_ADDY> is the IP of the Windows machine



Now, if I shell into the webserver and run the command, it works fine. BUT,
the system() looks like it fails...

Any hints? Can you tell me where else to look? 

--
Wellington








More information about the talk mailing list