Skip Menu |

This queue is for tickets about the Net-OpenSSH CPAN distribution.

Report information
The Basics
Id: 51544
Status: rejected
Worked: 2 min
Priority: 0/
Queue: Net-OpenSSH

People
Owner: salva [...] cpan.org
Requestors: dmcgarry [...] imagicity.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Host Keys not working in Net::OpenSSH 0.40
Date: Sun, 15 Nov 2009 11:52:21 +1100
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Dan McGarry <dmcgarry [...] imagicity.com>
I've been writing a small applet that uses SSH::RPC::Client to connect to a number of remote servers and monitor their status. The application works without issue using version 0.39 of Net::OpenSSH, but fails to connect to any of the remote hosts when using version 0.40. The connections are all enabled via password-less ssh keys bound to a single command on the remote server. The error message returned is related to authentication failure e.g.: Permission denied (publickey,password). Reverting to version 0.39 is a viable work-around. I suspect that the following change has something to do with the problem: --- /usr/local/share/perl/5.10.0/Net/OpenSSH.pm 2009-10-10 19:03:53.000000000 +1100 +++ /tmp/OpenSSH.pm 2009-11-15 11:31:01.000000000 +1100 @@ -1,6 +1,6 @@ package Net::OpenSSH; -our $VERSION = '0.39'; +our $VERSION = '0.40'; use strict; use warnings; @@ -434,13 +434,17 @@ my ($self, $async) = @_; $self->_set_error; + my @master_opts = (@{$self->{_master_opts}}, '-xMN'); + my $mpty; if (defined $self->{_passwd}) { _load_module('IO::Pty'); $self->{_mpty} = $mpty = IO::Pty->new; + push @master_opts, (-o => 'NumberOfPasswordPrompts=1', + -o => 'PreferredAuthentications=password'); } - my @call = $self->_make_call([@{$self->{_master_opts}}, '-xMN']); + my @call = $self->_make_call(\@master_opts); Show quoted text
-------------- SNIPPED -------------------------------- I suspect that the 'PreferredAuthentications=password' is being construed somehow to mean 'use only passwords', meaning that ssh keys are not used. (I'm basing this assumption mostly on the fact that it's the only remotely plausible change that I can see, not on any significant amount of testing beyond 'works in 0.39, but not in 0.40'.) -- Dan McGarry dmcgarry@imagicity.com Photography: http://www.imagicity.com/ Writing: http://scriptorum.imagicity.com/
I am unable to reproduce the problem. Could you attach your script source code?
Subject: Re: [rt.cpan.org #51544] Host Keys not working in Net::OpenSSH 0.40
Date: Mon, 16 Nov 2009 07:50:08 +1100
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Dan McGarry <dmcgarry [...] imagicity.com>
Salvador Fandino Garcia via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51544 > > > I am unable to reproduce the problem. > > Could you attach your script source code?
The relevant section is the dashboard_connect() subroutine (ll 753-775). -- Dan McGarry dmcgarry@imagicity.com Writing: http://scriptorum.imagicity.com/ Photos: http://www.imagicity.com/

Message body is not shown because it is too large.

The problem is that you are passing to the module... password => '' ... and so requesting password authentication. If you want key authentication use ... password => undef ... or just omit that parameter pair completely.
Subject: Re: [rt.cpan.org #51544] Host Keys not working in Net::OpenSSH 0.40
Date: Mon, 16 Nov 2009 14:34:40 +1100
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Dan McGarry <dmcgarry [...] imagicity.com>
Salvador Fandino Garcia via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=51544 > > > The problem is that you are passing to the module... > > password => '' > > ... and so requesting password authentication.
D'Oh! That makes perfect sense. Interesting that empty passwords did not behave like that in version 0.39.... Anyway, it's clear that OpenSSH.pm *should* accept any defined password. I'll make the necessary changes to my own code and add a note covering this to my docco. -- Dan McGarry dmcgarry@imagicity.com Writing: http://scriptorum.imagicity.com/ Photos: http://www.imagicity.com/