Thursday, December 13, 2001, 8:28:53 PM, Mike Gargiullo wrote:
> ok... I'm writing a perl program that will use scp to copy a file from
> one machine to another securely.

> The problem is that scp asks for the users password...  how can I have
> perl answer scp's request for a password...

> by hand it looks like so;

> $$scp -C test1111 [EMAIL PROTECTED]:test1111 
> [EMAIL PROTECTED]'s password:
> test1111             100%
> |*********************************************************************|
> 0       --:-- ETA
> $$

> I would like to run the command like:

> system("scp -C test1111 [EMAIL PROTECTED]:test1111");

> But how do I then feed it the password for user bob ?

there's a module called Net::SCP, which does scp in perl.

it says:

   Q: How do you supply a password to connect with ssh within a perl
   script using the Net::SSH module?

   A: You don't. Use RSA or DSA keys. See the ssh-keygen(1) manpage

http://theoryx5.uwinnipeg.ca/CPAN/data/Net-SCP/SCP.html

although if you're determined to do it the other way, you could look
at the Expect module: http://search.cpan.org/search?dist=Expect


-- 
Best Regards,
Daniel                                 [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to