Subject: | Can't connect to localhost, port 22... |
Date: | Tue, 10 Mar 2009 17:31:52 -0400 |
To: | <bug-Net-SSH-Perl [...] rt.cpan.org> |
From: | <JeanNathanael.BOCAR [...] sungard.com> |
Hello,
I'm pretty new using Perl and Linux.
I'm trying to write a script in order to connect to some servers using
the module "Net::SSH::Perl".
Unfortunately, each time I'm running my program, I have the following
error message:
Linasap01:prodjnb:/export/home/prodjnb/script>./connection.pl
Can't connect to localhost, port 22: Connection refused at
/usr/lib/perl5/vendor_perl/5.8.5/Net/SSH/Perl.pm line 209.
Here are the lines of "/usr/lib/perl5/vendor_perl/5.8.5/Net/SSH/Perl.pm"
where I have the problem looks to be from:
$ssh->debug("Connecting to $ssh->{host}, port $rport.");
209 connect($sock, sockaddr_in($rport, $raddr))
Here is some information about my system:
Linasap01:prodjnb:/export/home/prodjnb/script>uname -a
Linux Linasap01 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686
i686 i386 GNU/Linux
And here is my code so far:
#! /usr/bin/perl -w
# use module
use strict;
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new ("localhost",protocol=>1);
$ssh->login("sdmanager","glglgl");
I have spent long time trying to find a solution on Internet, but I
defnitely cannot find anything to solve it.
I thank you very muchin advance for your help.
Best regards,
Jean-Nat Bocar * Production Engineer/ Exchange Project Manager * SunGard
Global Trading * 440 South LaSalle Street, Suite 2202, Chicago, IL 60605
Tel +1(312)386-2412 / +1(312)351-0207 * Fax +1(312)922-0484 *
jeannathanael.bocar@sungard.com * www.sungard.com/globaltrading
Message body is not shown because it is too large.