Kirill has asked for the wisdom of the Perl Monks concerning the following question:
Here's the log:#!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";
And then programm hangs.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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SFTP. Script hangs. Bad repository?
by zentara (Cardinal) on Aug 09, 2010 at 12:12 UTC | |
by Kirill (Novice) on Aug 09, 2010 at 14:05 UTC | |
|
Re: Net::SFTP. Script hangs. Bad repository?
by moritz (Cardinal) on Aug 09, 2010 at 10:20 UTC | |
|
Re: Net::SFTP. Script hangs. Bad repository?
by Khen1950fx (Canon) on Aug 09, 2010 at 12:12 UTC |