Re: scp problems
| From: | (Richard Lynch) | Date: | Fri, 30 Jun 2000 21:36:52 +0000 |
| Subject: | Re: scp problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4168@lists.php.net to get a copy of this message | ||
In article <1160515.961813259512.JavaMail.imail@scorch.excite.com>,
jeremyf10@excite.com wrote:
> I'm trying to call scp from php to move files from my server to a user
> specified one. Using the follow exec fails because you can't specify the
> password via an option.
>
> $scp_path = "/usr/local/bin/scp -1 -q".
> $filename.$username."@".$host:$filename";
> (that's actually one line)
>
> exec($scp_path,$errors);
You may be able to do like this:
$scp_path = "echo $password\\\\n /usr/local/bin/scp -1 -q
$filename.$username@$host:$filename";
I'm not sure how many \s you need, but PHP uses them as escape, and so
does shell, so keep adding/deleting until it works.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)