Hi All , I am new to PERL , we are using SFTP to get the files from the remote server to our server .

I am able to do the SFTP to the remote server from commandline , but through PERL code i am getting errors.

I am using the Net::SFTP module, Please find the code i used below. i gave the password as null , since i am not using the password...

use Net::SFTP; my $host = 'HOST NUNBER'; my $user = 'USER ID'; my $password = ''; my $sftp = Net::SFTP->new($host,"user"=>$user,"password"=>$password,de +bug=>true); #$sftp->get("rolling_trade_report.csv");
i am getting the following error
"Permission denied at //pkgs/linux/intel/perl/5.8.0/lib/site_perl/5.8.0/Net/SFTP.pm line 62"
DEBUG Mode:
idwsit1m36: Reading configuration data /etrade/home/ibia_ir/.ssh/config
idwsit1m36: Reading configuration data /etc/ssh_config
idwsit1m36: Connecting to 217.154.215.76, port 22.
idwsit1m36: Remote protocol version 2.0, remote software version 1.82 sshlib: WinSSHD 4.23
idwsit1m36: Net::SSH::Perl Version 1.29, protocol version 2.0.
.dwsit1m36: No compat match: 1.82 sshlib: WinSSHD 4.23
idwsit1m36: Connection established.
idwsit1m36: Sent key-exchange init (KEXINIT), wait response.
idwsit1m36: Algorithms, c->s: 3des-cbc hmac-sha1 none
idwsit1m36: Algorithms, s->c: 3des-cbc hmac-sha1 none
idwsit1m36: Entering Diffie-Hellman Group 1 key exchange.
idwsit1m36: Sent DH public key, waiting for reply.
idwsit1m36: Received host key, type 'ssh-dss'.
idwsit1m36: Host '217.154.215.76' is known and matches the host key.
idwsit1m36: Computing shared secret key.
idwsit1m36: Verifying server signature.
idwsit1m36: Waiting for NEWKEYS message.
idwsit1m36: Enabling incoming encryption/MAC/compression.
idwsit1m36: Send NEWKEYS, enable outgoing encryption/MAC/compression.
idwsit1m36: Sending request for user-authentication service.
idwsit1m36: Service accepted: ssh-userauth.
idwsit1m36: Trying empty user-authentication request.
idwsit1m36: Authentication methods that can continue: publickey,gssapi-with-mic,password.
idwsit1m36: Next method to try is publickey.
idwsit1m36: Next method to try is password.
idwsit1m36: Trying password authentication.
idwsit1m36: Will not query passphrase in batch mode.
idwsit1m36: Authentication methods that can continue: publickey,gssapi-with-mic,password.
idwsit1m36: Next method to try is publickey.
idwsit1m36: Next method to try is password.
idwsit1m36: Trying password authentication.
idwsit1m36: Will not query passphrase in batch mode.
idwsit1m36: Authentication methods that can continue: publickey,gssapi-with-mic,password.
idwsit1m36: Next method to try is publickey.
idwsit1m36: Next method to try is password.
idwsit1m36: Trying password authentication.
idwsit1m36: Will not query passphrase in batch mode.
idwsit1m36: Authentication methods that can continue: .
Permission denied at //pkgs/linux/intel/perl/5.8.0/lib/site_perl/5.8.0/Net/SFTP.pm line 62
Please help me to solve this.
Thanks,
Prasanna

In reply to SFTP Issue by prasanna14

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.