Technically, the error I'm seeing is from Net::SSH::Perl, but it cropped up through use of Net::SFTP.

I have a very small script that I'm using to test connectivity with an SFTP server:

#!/usr/bin/perl -l use strict; use Net::SFTP; my ( $host, $user, $pass ) = ( ... ); my $sftp = Net::SFTP->new( $host, user => $user, password => $pass, ssh_args => [ debug => 1 ] );
However, there seems to be a problem with this that I have been unable to track down so far:
%perl sftp_test.pl Reading configuration data /usr/home/*****/.ssh/config Reading configuration data /etc/ssh_config Connecting to *************, port 22. Remote version string: SSH-2.0-VShell_2_3_1_151 VShell Remote protocol version 2.0, remote software version VShell_2_3_1_151 + VShell Net::SSH::Perl Version 1.30, protocol version 2.0. No compat match: VShell_2_3_1_151 VShell Connection established. Sent key-exchange init (KEXINIT), wait response. Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none Entering Diffie-Hellman Group 1 key exchange. Sent DH public key, waiting for reply. Received disconnect message: Invalid packet header. This probably ind +icates a problem with key exchange or encryption. at /usr/local/lib/p +erl5/site_perl/5.8.4/Net/SSH/Perl/Kex/DH1.pm line 41

I am able to connect to the server through the sftp command line utility just fine. The module usage seems to be pretty straight-forward, but I suppose I could be missing something. I've tried passing it both SSH1 and 2, and all of the compatible cyphers for each through 'ssh_args', but with no luck.

If anyone more experienced than I with Net::SFTP or Net::SSH::Perl could shine some light on this for me, that would be most excellent.

-Andy

In reply to Net::SFTP 'invalid packet header' by timecatalyst

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.