Computing.Net > Forums > Programming > Net SSH Perl

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Net SSH Perl

Reply to Message Icon

Name: mongar
Date: January 14, 2006 at 14:57:04 Pacific
OS: win2000
CPU/Ram: 512
Comment:

i have installed successfuly Net-SSH-Perl [1.29] on my xp proffesional ,when i am running this simple code :
use Net::SSH::Perl;
$host="127.0.0.1";
my $ssh = Net::SSH::Perl->new($host);

i get an error code :

Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib/Net/SSH/P
erl.pm line 212, <GEN0> line 1.

i have tried it on a second computer and got the same results.
does anybody know about this problem?
please advise.



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: January 14, 2006 at 15:12:02 Pacific
Reply:

I don't think it will allow you to ssh to yourself, but I've never tried it. If it will, it would be better to use your actual ip address or hostname, not the loopback address.

It would be much better to test your script by ssh'ing to another system.


0

Response Number 2
Name: mongar
Date: January 16, 2006 at 11:48:37 Pacific
Reply:

i have tried to ssh to another diffrent computer with the same syntax
$host="10.10.15.4";
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);

but i got the same error :
Can't set socket non-blocking: Bad file descriptor at C:/Perl/lib/Net/SSH/Perl.p
m line 212, <GEN0> line 1.

i know its ridiculos to ask but
did somebody ever tried it on an windows machine?


0

Response Number 3
Name: FishMonger
Date: January 16, 2006 at 19:48:36 Pacific
Reply:

After checking on aspn.activestate.com, it appears that this is a known issue. The recommended solution is to use Net::SSH::W32Perl instead, however I received the same error using that module as well. I'm not sure what else to suggest.


0

Response Number 4
Name: nato
Date: January 24, 2006 at 15:59:45 Pacific
Reply:

I had the same problem.

Editing the file C:/Perl/lib/Net/SSH/Perl.pm and commenting out lines 212 and 213 as follows let it run for me.


$ssh->{session}{sock} = $sock;
$ssh->_exchange_identification;

# defined($sock->blocking(0))
# or die "Can't set socket non-blocking: $!";

$ssh->debug("Connection established.");
}

I don't know how this affects the actual execution or whether this is a really bad fix, but my script seems to run okay.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


C++ Help - rdbuf() Highlighting a cell in a ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Net SSH Perl

Net SSH www.computing.net/answers/programming/net-ssh/13820.html

Net::SSH bad packet length error www.computing.net/answers/programming/netssh-bad-packet-length-error-/17301.html

perl net::ssh www.computing.net/answers/programming/perl-netssh-/14236.html