http://qs321.pair.com?node_id=1227204


in reply to Net::SSH2 error - Username/PublicKey combination invalid

That probably means that the remote host has not accepted the given public key as valid for the user.
  • Comment on Re: Net::SSH2 error - Username/PublicKey combination invalid

Replies are listed 'Best First'.
Re^2: Net::SSH2 error - Username/PublicKey combination invalid
by BernieC (Pilgrim) on Dec 13, 2018 at 21:06 UTC
    Eli the Bearded <*@eli.users.panix.com> wrote: } Really does sound like the user/key pair isn't right. I've checked a bunch more -- I turned on logging in my SSH client and, indeed, it, too, fails. Grumble.

    Now I'm not sure why -- I *thought* perhaps incorrectly?? that SSH key pairs were server agnostic. That is, I thought/assumed that if my public/private key work on server A they'll work on server B. Apparently that is not the case and at the moment I have no clue why. So not a perl problem, which I might have had a chance of dealing with, but SSH key exchange problem about which I have no clue. Off to try to understand it.. Sorry to think this is a Perl problem... /Bernie\

      Problem solved! A unix-friend made a suggestion that proved to be correct: the authorized_keys file has to be non-writable. I had just copied in the key so it got some default protections. chmod 710 did the trick. Sorry to bother you guys...