Hello thanks for the reply.
I have modified my code like this:
my $targetserver = 'files.responsys.net'; my $sftp = Net::SFTP->new( $targetserver, user => 'canneu_scp', ssh_args => { identity_files => [ '/tmp/responsys/capgemini.private' ], debug => 1, } ) or die "could not open connection to $targetserver\n";
Now when I run this, I am getting the following error:
can-ornstein:[/tmp/responsys] ./testftp.pl can-ornstein: Reading configuration data /home/home2/cgmjoshi/.ssh/con +fig can-ornstein: Reading configuration data /etc/ssh_config can-ornstein: Connecting to files.responsys.net, port 22. can-ornstein: Remote protocol version 2.0, remote software version Ope +nSSH_5.2 can-ornstein: Net::SSH::Perl Version 1.34, protocol version 2.0. .an-ornstein: No compat match: OpenSSH_5.2 can-ornstein: Connection established. can-ornstein: Sent key-exchange init (KEXINIT), wait response. can-ornstein: Algorithms, c->s: 3des-cbc hmac-sha1 none can-ornstein: Algorithms, s->c: 3des-cbc hmac-sha1 none can-ornstein: Entering Diffie-Hellman Group 1 key exchange. can-ornstein: Sent DH public key, waiting for reply. Key class 'Net::SSH::Perl::Key::DSA' is unsupported: Math::BigInt vers +ion 1.78 required--this is only version 1.70 at /usr/lib/perl5/vendor +_perl/5.8.5/Crypt/DSA/KeyChain.pm line 4, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/ +Crypt/DSA/KeyChain.pm line 4, <GEN0> line 1. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Cryp +t/DSA.pm line 7, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/ +Crypt/DSA.pm line 7, <GEN0> line 1. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/Net/ +SSH/Perl/Key/DSA.pm line 14, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/ +Net/SSH/Perl/Key/DSA.pm line 14, <GEN0> line 1. Compilation failed in require at (eval 23) line 1, <GEN0> line 1. BEGIN failed--compilation aborted at (eval 23) line 1, <GEN0> line 1.
The versions I am using are:
perl-Net-SFTP-0.10-1.el4.rf perl-Net-SSH-Perl-1.34-1.el4.rf perl-Math-Pari-2.01080603-1.el4.rf perl-Math-GMP-2.05-1.el4.rf
Can anyone help how to get rid of this error?

In reply to Re: How to use identity files in Net::SFTP by rachanakunal
in thread How to use identity files in Net::SFTP by rachanakunal

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.