Hi jcb,

Thank you for the pointer, unfortunatelly it does not work.

I've seen that on other modules like Net::SSH2, auth_publickey expects the path for both public and private keys.

It appears not to be the case with Net::SSH::Perl. Adding the public key does not change the outcome:

my %params = ( "protocol" => '2', "use_pty" => 0, "options" => ["stricthostkeychecking no"], "identity_files" => ["client_key","client_key.pub"], "debug" => 1, ); $ssh = Net::SSH::Perl->new($server, %params);# debug=>1, identity_file +s=>\@KEYFILE); $ssh->login();
localhost: Authentication methods that can continue: publickey,passwor +d,keyboard-interactive. localhost: Next method to try is publickey. localhost: Trying pubkey authentication with key file 'client_key' Wrong key type at C:/Strawberry/perl/site/lib/Net/SSH/Perl/Auth/Public +Key.pm line 83.

If I try having the public key in the first place it just fails and tries the next one:

localhost: Next method to try is publickey. localhost: Trying pubkey authentication with key file 'client_key.pub' Use of uninitialized value $object in substitution (s///) at C:/Strawb +erry/perl/site/lib/Net/SSH/Perl/Key.pm line 109. Use of uninitialized value $object in substitution (s///) at C:/Strawb +erry/perl/site/lib/Net/SSH/Perl/Key.pm line 109. localhost: Will not query passphrase for 'client_key.pub' in batch mod +e. Use of uninitialized value $object in substitution (s///) at C:/Strawb +erry/perl/site/lib/Net/SSH/Perl/Key.pm line 109. Use of uninitialized value $object in substitution (s///) at C:/Strawb +erry/perl/site/lib/Net/SSH/Perl/Key.pm line 109. localhost: Loading private key failed. localhost: Trying pubkey authentication with key file 'client_key' Wrong key type at C:/Strawberry/perl/site/lib/Net/SSH/Perl/Auth/Public +Key.pm line 83.

I'm going to try all the key formats I manage to generate to check if there any issue there, since I don't know what else might be causing the problem.

Regards.


In reply to Re^2: net::ssh::perl Wrong key type by jpsaraiva
in thread net::ssh::perl Wrong key type by jpsaraiva

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.