use Net::SFTP::Recursive; my $host = 'x.x.x.x'; my %cfg = ( user=>'user', password=>'passwd', ssh_args => [ protocol => "2 1", use_pty => 0 ], debug => 'true' ); my $sftp = Net::SFTP::Recursive->new($host,%cfg);