http://qs321.pair.com?node_id=1233380


in reply to SFTP connection failure with Perl “Net::SFTP” module

Hello Michaels,

I would suggest to comment out the identity_files and also password. Simply do this:

#!/usr/bin/perl use strict; use warnings; use Net::SFTP; my $host = '127.0.0.1'; my %args = ( user => 'user', ssh_args => [ port => "10022" ] ); my $sftp = Net::SFTP->new($host, %args); my $ls = $sftp->ls('/sample/path'); print "$_->{filename}\n" for (@$ls);

I would also suggest to use the module Net::SFTP::Foreign. You can find more information as to why on a previoudly asked question Re: Using Net::SFTP.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!