Good morning/afternoon/evening, all.
I inherited a Zabbix (v3.2.6 on RHEL 7.3) monitoring environment and am tasked with creating an action for restarting a service on a triggering host. I have created an Action Operation using SSH to run the commands on the host, but I don't like the password method of connecting. (It worked when I tested it, but the password is not cloaked, and I don't want it seen.)
I am trying to use the public key method, therefore. So, I took these steps to make that happen:
- Created, chown'ed, and chmod'ed the zabbix user's home directory at /var/lib/zabbix.
- Ran ssh-keygen to create the key pair.
- Modified /etc/zabbix/zabbix_server.conf to point it to /var/lib/zabbix/.ssh.
- Used ssh-copy-id to copy the public key to the affected host.
- Configured the operation (within the action) to connect via the "zabbix" user and provided id_rsa.pub and id_rsa as the public and private keys, resp.
- Killed the service I was testing (apache2) on the affected host.
The action fired, and the error I received was that in the subject, "Public key authentication failed: Username/PublicKey combination invalid".
I've searched the web and searched these forums and cannot find what I'm doing wrong. Would appreciate some help, if you can provide it.
Thanks in advance!
I inherited a Zabbix (v3.2.6 on RHEL 7.3) monitoring environment and am tasked with creating an action for restarting a service on a triggering host. I have created an Action Operation using SSH to run the commands on the host, but I don't like the password method of connecting. (It worked when I tested it, but the password is not cloaked, and I don't want it seen.)
I am trying to use the public key method, therefore. So, I took these steps to make that happen:
- Created, chown'ed, and chmod'ed the zabbix user's home directory at /var/lib/zabbix.
- Ran ssh-keygen to create the key pair.
- Modified /etc/zabbix/zabbix_server.conf to point it to /var/lib/zabbix/.ssh.
- Used ssh-copy-id to copy the public key to the affected host.
- Configured the operation (within the action) to connect via the "zabbix" user and provided id_rsa.pub and id_rsa as the public and private keys, resp.
- Killed the service I was testing (apache2) on the affected host.
The action fired, and the error I received was that in the subject, "Public key authentication failed: Username/PublicKey combination invalid".
I've searched the web and searched these forums and cannot find what I'm doing wrong. Would appreciate some help, if you can provide it.
Thanks in advance!
Comment