Hi Monks, I am new to perlmonks. I have a problem with Net::sftp module. I need to transfer files regularly between two servers using Sftp and I am using Net::Sftp module in my code.I wrote a small script to test the system :-
########################################## #!/usr/local/bin/perl use Net::SSH::Perl; use strict; my $host = "***********"; print $ENV{"HOME"}."\n"; my %params=( identity_files =>["/home/vendor2/.ssh/id_dsa"],protocol=> +'2',debug => 1); my $ssh = Net::SSH::Perl->new($host,%params); $ssh->login("vendor1") ; my $cmd = "ls -ltr "; my ($stdout) = $ssh->cmd($cmd); print $stdout; ##########################################
The Error which I am geting is --
Myserver: Reading configuration data /home/hygtest/.ssh/config Myserver: Reading configuration data /etc/ssh_config Myserver: Connecting to **********, port 22. Myserver: Remote protocol version 1.99, remote software version OpenSS +H_3.8.1p1 Myserver: Net::SSH::Perl Version 1.28, protocol version 2.0. Myserver: No compat match: OpenSSH_3.8.1p1. Myserver: Connection established. Myserver: Sent key-exchange init (KEXINIT), wait response. Myserver: Algorithms, c->s: 3des-cbc hmac-sha1 none Myserver: Algorithms, s->c: 3des-cbc hmac-sha1 none Myserver: Entering Diffie-Hellman Group 1 key exchange. Myserver: Sent DH public key, waiting for reply. Myserver: Received host key, type 'ssh-dss'. Myserver: Permanently added '*********' to the list of known hosts. Myserver: Computing shared secret key. Myserver: Verifying server signature. Key verification failed for server host key at /usr/opt/perl5/lib64/si +te_perl/5.8.0/Net/SSH/Perl/SSH2.pm line 87 #######################################
If i manually do sftp from command line from Vendor2 to Vendor1, I easily pass thru to vendor1..
Kindly suggest some solution. I have gone through earlier postings but was not able to find similar kind of error.

Thanx in advance,
Zoop
'When You starve With A Tiger, The Tiger always starves last'

In reply to Net::SFTP Problem by Zoop

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.