Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Welcome to the Monastery
 
PerlMonks  

Re: Net::SFTP::Foreign frequent connection server stall

by zentara (Archbishop)
on Jun 19, 2012 at 17:54 UTC ( #977133=note: print w/ replies, xml ) Need Help??


in reply to Net::SFTP::Foreign frequent connection server stall

You didn't mention trying Net::SSH2, it might be worth a try.

#!/usr/bin/perl use warnings; use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('localhost') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('z','ztester') or die "Unable to login $@ \n"; #get a large file like a 100Meg wav file my $dir = '/home/whoever'; my $remote1 = $dir.'/1.wav'; use IO::File; my $local1 = IO::File->new("> 2.wav"); #it needs a blessed reference $ssh2->scp_get($remote1, $local1); __END__

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Net::SFTP::Foreign frequent connection server stall
Download Code
Re^2: Net::SFTP::Foreign frequent connection server stall
by Anonymous Monk on Jun 20, 2012 at 15:18 UTC
    Hello Zentara,
    I have not tried using Net::SSH2, but interested in learning what considerations one should go through when deciding to use SSH2 vs. SFTP. (as I am still very new to using Perl and open source... I find very hard to navigate)
      Hi, Net::SSH2 was designed to replace the old sftp and ssh module. You can ask the SSH experts on the maillist at ssh-sftp-perl maillist for all the details. The switch started about 10 years ago, and at the time the most important reason was to eliminate the numerous math library dependencies , like Math::Pari which was an installation hassle, and often resulted in sftp dropping back to very slow pure Perl math processing. It also brought all of the various ssh utilities, like sftp, scp, ssh under one module. I've found it easy to install and use, as it only requires libssh2 to be installed with it's development headers.

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
        zentara, Net::SFTP::Foreign is not any of the old sftp and ssh modules Net::SSH2 intended to replace.

        Net::SSH2 is a great module, but it is far from being the only one or even the best SSH module currently available. Specifically, as a wrapper of a C library, it is very low level, not very perlish and in general hard to use. Its support for the SFTP protocol is rather rude and inefficient. And besides that, the underlying libssh2 is not as mature as other SSH implementations with new bugs being discovered all the time.

        I am highly biased here, but IMO, on Unix/Linux, Net::OpenSSH and Net::SFTP::Foreign are far superior to Net::SSH2.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977133]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2013-05-25 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (519 votes), past polls