[Ssh-sftp-perl-users] [Net::SFTP] SSH Error: "No compat match: OpenSSH_4.1 Can't set socket non-blo
Brought to you by:
dbrobins
From: Rashid J. <ras...@go...> - 2008-07-01 16:23:59
|
Dear all I have used Perl to some degree in the past, but more recently I am using it more. Goodbye Javasaurus! That being said, I need a little help with the Net related modules. I am trying to transfer some files from a WinXP machine (my PC) to a Solaris box. Alas I get the following error: C:\projects\webbi\gmail>test.pl Connecting to bisdwdbdev... OSTWS0075853: Reading configuration data c:/.ssh/config OSTWS0075853: Reading configuration data /etc/ssh_config OSTWS0075853: Connecting to bisdwdbdev, port 22. OSTWS0075853: Remote version string: SSH-2.0-OpenSSH_4.1 OSTWS0075853: Remote protocol version 2.0, remote software version OpenSSH_4.1 OSTWS0075853: Net::SSH::Perl Version 1.30, protocol version 2.0. OSTWS0075853: *No compat match: OpenSSH_4.1.* *Can't set socket non-blocking*: Bad file descriptor at C:/tools/perl/perl-5.8.8/site/lib/Net/SSH/Perl.pm line 216. My test script is: # sub test_sftp { my $host = DB_SERVER_IP; my $user = DB_SERVER_USERNAME; my $password = DB_SERVER_PASSWORD; my %args = ( user => $user, password => $password, debug => 1, ssh_args => [] ); print "Connecting to $host...\n"; my $sftp = Net::SFTP->new( $host, %args ) || die "Can't connect: $@"; } The error message implies that it is dying in lib/Net/SSH/Perl.pm, here: *"Can't set socket non-blocking: $!"* sub _connect { my $ssh = shift; my $sock = $ssh->_create_socket; my $raddr = inet_aton($ssh->{host}); croak "Net::SSH: Bad host name: $ssh->{host}" unless defined $raddr; my $rport = $ssh->{config}->get('port') || 'ssh'; if ($rport =~ /\D/) { my @serv = getservbyname(my $serv = $rport, 'tcp'); $rport = $serv[2] || 22; } $ssh->debug("Connecting to $ssh->{host}, port $rport."); connect($sock, sockaddr_in($rport, $raddr)) or die "Can't connect to $ssh->{host}, port $rport: $!"; select((select($sock), $|=1)[0]); $ssh->{session}{sock} = $sock; $ssh->_exchange_identification; *## BOMBING OUT HERE:* * defined($sock->blocking(0))* * or die "Can't set socket non-blocking: $!";* $ssh->debug("Connection established."); } I have googled for the posts related to *'No compat match: OpenSSH_4.1'*, but to no avail. Also I couldn't see any relevant examples in the ActiveState port of Perl. The POD perhaps refers to the a Unix port. [i.e. For samples/tutorials, take a look at the scripts in *eg/* in the distribution directory.] I would appreciate any guidance that you chaps can offer. Many thanks in advance Rashid Jeffrey |