in reply to Re^2: Net::SFTP::Foreign is slow
in thread Net::SFTP::Foreign is slow

syphilis is right, you can't use more or ssh_cmd with the Net_SSH2 backend.

Do as follows:

use Net::SFTP::Foreign 1.67; use Net::SFTP::Foreign::Backend::Net_SSH2 0.04; my $sftp = Net::SFTP::Foreign->new( host => 'delivery.myserver.com', port => '22', backend => 'Net_SSH2', user => 'ftp_user', key_path => "mytransaction.private +.key"); $sftp->die_on_error("Unable to establish SFTP connection");
You will probably have to convert the private key from PuTTY to OpenSSH format and place the public key in the same directory with the .pub suffix.

Replies are listed 'Best First'.
Re^4: Net::SFTP::Foreign is slow
by ssubrat77 (Novice) on Jul 13, 2011 at 05:01 UTC

    Hi Rob,

    I am getting an error "Invalid option 'key_path' or bad combination of options". Can you please advise.

    use Net::SFTP::Foreign 1.67; use Net::SFTP::Foreign::Backend::Net_SSH2 0.04; my $sftp = Net::SFTP::Foreign->new( host => 'delivery.myserver.com', port => '22', backend => 'Net_SSH2', user => 'ftp_user', key_path => "mytransaction.private +.key"); $sftp->die_on_error("Unable to establish SFTP connection");
      There was a bug on Net::SFTP::Foreign::Backend::Net_SSH2 0.04.

      Get the new 0.05 I have just uploaded to CPAN or just use privatekey instead of key_path:

      my $sftp = Net::SFTP::Foreign->new( host => 'delivery.myserver.com', port => '22', backend => 'Net_SSH2', user => 'ftp_user', privatekey => "mytransaction.priva +te.key");
        Get the new 0.05 ...

        0.05 has now been uploaded to the sisyphusion repo.
        Of course, Net::SFTP::Foreign::Backend::Net_SSH2 (like Net::SFTP::Foreign) is pure perl, so it's quite simple to install from source once the pre-requisite Net::SSH2 has been installed ... but I'd just as soon put up the ppm package and leave it at that :-)

        Cheers,
        Rob
Re^4: Net::SFTP::Foreign is slow
by ssubrat77 (Novice) on Jul 12, 2011 at 18:17 UTC

    Hi Selva,

    Foreign 1.67 and Net_SSH2 0.04 is not available under PPM and seems to be Foreign 1.65 and Net_SSH2 0.03 does not support the method you have advised. can you please guide me how to install those versions in Windows environment. Thanks for your valuable help.

      Foreign 1.67 and Net_SSH2 0.04 is not available under PPM

      The sisyphusion ppm repo has now been updated to versions 1.67 and 0.04 respectively. (Net::SSH2 has also been updated to 0.38 - was at 0.35.)

      Cheers,
      Rob