Subject: | Net SFTP Problem |
Date: | Mon, 14 Apr 2008 10:25:50 +0100 |
To: | bug-Net-SFTP [...] rt.cpan.org |
From: | "Seán Lane" <seanlane20 [...] gmail.com> |
Hi,
I am relatively new to perl and I am attempting to get a script
working that uses SFTP. The script I am using is:
#!/usr/bin/perl -w
use Net::SFTP;
#my $host = "10.104.20.14";
my $host = "10.51.4.19";
my %args = (
user => '*****',
password => '****',
debug => 'false'
);
my $sftp = Net::SFTP->new($host, %args);
print "connected!";
$sftp->get("/tmp/tmp/test2.txt", "/home/advserv/sean/test2.txt");
undef %sftp;
When I run this script, it only works intermittently, i.e. sometimes
it works fine, but more often then not, I get the folllowing error:
# ./sftp2.pl
Name "main::sftp" used only once: possible typo at ./sftp2.pl line 20.
advlogs: Reading configuration data /home/advserv/.ssh/config
advlogs: Reading configuration data /etc/ssh_config
advlogs: Connecting to 10.51.4.19, port 22.
advlogs: Remote version string: SSH-2.0-OpenSSH_4.1
advlogs: Remote protocol version 2.0, remote software version OpenSSH_4.1
advlogs: Net::SSH::Perl Version 1.30, protocol version 2.0.
advlogs: No compat match: OpenSSH_4.1.
advlogs: Connection established.
advlogs: Sent key-exchange init (KEXINIT), wait response.
advlogs: Algorithms, c->s: 3des-cbc hmac-sha1 none
advlogs: Algorithms, s->c: 3des-cbc hmac-sha1 none
Segmentation Fault (core dumped)
I have the core file that is dumped if you require it.
Also, here is some extra information on some versions I am using.
- Net-SFTP-0.10
- # perl -v
This is perl, v5.6.1 built for sun4-solaris-64int
(with 48 registered patches, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
- # uname -a
SunOS advlogs 5.9 Generic_118558-06 sun4u sparc SUNW,Ultra-4
I would greatly appreciate some help with this, and if you reuqire
soem exttra information, please let me know.
Thanks and regards,
Sean.