
alex at gossamer-threads
Jun 9, 2010, 10:39 AM
Post #1 of 3
(897 views)
Permalink
|
|
ssh needs a default port specified
|
|
Hi, Just ran accross this on a 2.0 install: [Wed Jun 9 03:21:36 2010] [error] [client 154.20.204.91] Unable to login to remote server 'xxx'.: Net::SSH2::connect: failed to connect to xxx:: Invalid argument at /var/home/xxx/bricolage/lib/Bric/Util/Trans/SFTP.pm line 139 Net::SSH2 doesn't like being called without a port: --- SFTP.pm.orig 2010-04-11 12:57:39.000000000 -0700 +++ SFTP.pm 2010-06-09 10:30:49.000000000 -0700 @@ -131,6 +131,7 @@ # Instantiate a Net::SSH2 object and login. my ($hn, $port) = split /:/, $s->get_host_name; + $port ||= 22; my $user = $s->get_login; my $password = $s->get_password; @@ -264,6 +265,7 @@ # Instantiate a Net::SSH2 object and login. my ($hn, $port) = split /:/, $s->get_host_name; + $port ||= 22; my $user = $s->get_login; my $password = $s->get_password; and was failing to connect without defaulting it to 22. Looking at our Net::SSH2, it has: if (@_ == 2) { require IO::Socket::INET; $sock = IO::Socket::INET->new(PeerHost => $_[0], PeerPort => $_[1]); croak "Net::SSH2::connect: failed to connect to $_[0]:$_[1]: $!" unless $sock; $sock->sockopt(SO_LINGER, pack('SS', 0, 0)); } so I think you need to default it to 22. Cheers, Alex -- Alex Krohn <alex [at] gossamer-threads>
|