#!/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 ] ); #### %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 indicates a problem with key exchange or encryption. at /usr/local/lib/perl5/site_perl/5.8.4/Net/SSH/Perl/Kex/DH1.pm line 41