Hello, guys.
I'm working with perl now and i've faced with a problem with creating the script for connecting to SFTP server using perl modules Net::SFTP and Net::SSH::W32Perl. I would be really glad, if you could help me. I've spent a lot of days trying to solve my problem. I'm creating a script for copying the file from my local machine to a remote host via SFTP. The problem is that after loginning to server the program hangs on:

channel 1: open confirm rwindow 0 rmax 32768

I've searched a lot about this and I figured out that for escaping this problem I need to installing SFTP and SSH modules from repository on the website http://www.soulcage.net/ppds/ can solve this problem. But this website does not exist any more. So I was wondering, may be someone know where to find these modules, so my programm would work. Cause I've tried a lot of them from different repositories, but it didn't help me. Or may be there's any other way to solve this. I would appreciate any help.
Here's the script:
#!usr/local/bin/perl -w use Net::SSH::W32Perl; use Net::SFTP; BEGIN { $ENV{HOME} = $ENV{APPDATA} || $ENV{USERPROFILE} } print "\nTryin' to connect. Please wait...\n"; my $login="****"; my $pass="****"; my $host='***.***.***.***'; my @args=(user => $login, password => $pass, ssh_args => [port=>22, debug => 1]); my $localfile='D:\\test.txt'; my $remotefile='/folder1/folder2/folder3/folder4/folder5'; my $sftp; $sftp=Net::SFTP->new($host, @args); $sftp->error and die "Connection failed: " . $sftp->error; print "\nConnection was established successfully\n"; $sftp->put($localfile, $remotefile) or die "Can't put file: $!\n"; $sftp->close() or die "Disconnect error: $!\n"; print "ok";
Here's the log:

myuser: Connecting to ***.***.***.***, port 22. myuser: Remote version string: SSH-2.0-OpenSSH_4.3 myuser: Remote protocol version 2.0, remote software version OpenSSH_4 +.3 myuser: Net::SSH::Perl Version 1.30, protocol version 2.0. myuser: No compat match: OpenSSH_4.3. myuser: Connection established. myuser: Sent key-exchange init (KEXINIT), wait response. myuser: Algorithms, c->s: 3des-cbc hmac-sha1 none myuser: Algorithms, s->c: 3des-cbc hmac-sha1 none myuser: Entering Diffie-Hellman Group 1 key exchange. myuser: Sent DH public key, waiting for reply. myuser: Received host key, type 'ssh-dss'. myuser: Host '***.***.***.***' is known and matches the host key. myuser: Computing shared secret key. myuser: Verifying server signature. myuser: Waiting for NEWKEYS message. myuser: Enabling incoming encryption/MAC/compression. myuser: Send NEWKEYS, enable outgoing encryption/MAC/compression. myuser: Sending request for user-authentication service. myuser: Service accepted: ssh-userauth. myuser: Trying empty user-authentication request. myuser: Authentication methods that can continue: publickey,gssapi-wit +h-mic,password. myuser: Next method to try is publickey. myuser: Next method to try is password. myuser: Trying password authentication. myuser: Login completed, opening dummy shell channel. myuser: channel 0: new [client-session] myuser: Requesting channel_open for channel 0. myuser: channel 0: open confirm rwindow 0 rmax 32768 myuser: channel 1: new [client-session] myuser: Requesting channel_open for channel 1. myuser: Sending subsystem: sftp myuser: Requesting service subsystem on channel 1. myuser: channel 1: open confirm rwindow 0 rmax 32768
And then programm hangs.
Pleasu, hepl me with this trouble. Waiting for your reply.

In reply to Net::SFTP. Script hangs. Bad repository? by Kirill

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.