Ad Widget

Collapse

Public Key Authentication Failed when running SSH Action/Operation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jholton2
    Junior Member
    • Jul 2018
    • 1

    #1

    Public Key Authentication Failed when running SSH Action/Operation

    Hey all,

    I'm trying to fire off a script on a remote server via an SSH Operation using "Public Key" for authentication, and it's failing.

    I see the action firing and attempting to run, but every time it fails with "Public Key Authentication Failed: callback returned error".

    I can definitely ssh directly from my Zabbix server to the remote server using the username/cert combo that I'm configuring in the Operation dialog. I made the required change to the Zabbix config file to point it to the certs' directory (/home/zabbix/.ssh). I made sure to chmod 700 on the directory and chmod 600 on the private and public keys. The Zabbix user owns the directory.

    Can anyone help me figure out what might be causing this SSH command to fail?

    Thanks!
  • paesa
    Junior Member
    • Aug 2018
    • 1

    #2
    Did you solve it? I have the same error.
    Last edited by paesa; 22-08-2018, 17:52.

    Comment

    • doum
      Member
      • Oct 2019
      • 35

      #3
      idem here same error

      works perflecty as cli, using passphrase, but in zabbix I've got the same error

      Comment

      • walter.egosson
        Junior Member
        • Aug 2020
        • 2

        #4
        have the exact same issue:
        1/ sudo su - u zabbix ssh -i /var/lib/zabbix/.ssh/zabbix_rsa root@host_ip works file and give a root prompt
        2/ using ssh agent with public key does not work (set everything up according to doc), the error is: Public key authentication failed: Callback returned error
        3/ using ssh agent with password instead of public key works fine

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          Does the SSH keypair have a passphrase associated with the private key, or is it password-less?

          Comment


          • walter.egosson
            walter.egosson commented
            Editing a comment
            just found out!
            The issue was related to the ssh key format.
            ssh-keygen (debian buster) generate a new key format wich can be recognized by its header (-----BEGIN OPENSSH PRIVATE KEY-----)

            I had to re-generate the public/private keys with ssh-keygen -m PEM which uses the old format (-----BEGIN RSA PRIVATE KEY-----)

            Should be written somewhere
        • jro123
          Junior Member
          • Aug 2019
          • 3

          #6
          I still have this issue. When I clone an existing item i get this error. So I have one that works and one that returns this error.

          My keyfile is RSA PRIVATE KEY like Walter suggested.
          From cli I can manually ssh as zabbix user
          My server is running version 5.0.2

          Thanks

          Comment

          Working...