in reply to SFTP Issue

This worked for me:

#!/usr/bin/perl use strict; use warnings; use Net::SFTP; my $host = 'localhost'; my $remote = '/usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm'; my $local = '/path/to/Desktop'; my %args = ( user => 'someuser', password => 'somepassword', debug => 1 ); my $sftp = Net::SFTP->new($host, %args); $sftp->get($remote, [$local]);

Replies are listed 'Best First'.
Re^2: SFTP Issue
by prasanna14 (Initiate) on Jul 16, 2008 at 15:32 UTC
    Khen
    i used your code , still i am getting the same error, the only modification is i gave the password as '' (null).

    use strict; use warnings; use Net::SFTP; my $host = '217.154.215.76'; my $remote = '/usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm'; my $local = '/path/to/Desktop'; my %args = ( user => 'username', password => '', debug => 1 ); my $sftp = Net::SFTP->new($host, %args); #$sftp->get($remote, [$local]);
    the error
    Permission denied at //pkgs/linux/intel/perl/5.8.0/lib/site_perl/5.8.0/Net/SFTP.pm line 62

    In the sftp.pm code, line 62 it corresponds to login , will it not login with null password.

    Prasanna

      I tried it with null password and got permission denied. I tried it without password and got the same thing. It seems to want a password---so try that.
        Khen , Thanks for your reply , actually we are connecting to a vendor for few files , So is it that we need to ask the vendor for passwords to be set for our account.

        if password is set for our account , then will it use the publick keys?

        Also in the NET::SFTP module in SFTP they have mentioned under "password " as "if you use public key authentication, this argument is unused" .