patricegautier / unifiZabbix

Zabbix templates to monitor pretty much all Unifi devices
181 stars 36 forks source link

Priv Key accessibility issue #109

Closed heremansgeert closed 10 months ago

heremansgeert commented 10 months ago

When I'm trying to run

sudo -u zabbix ssh -i <fullPathToYourPrivateKey> yourUserName@oneOfYourUnifiDevicesIP

I get a warning Warning: Identity file /home/<myusername>/.ssh/zabbix/zb_id_rsa not accessible: Permission denied

The rights of the files are the same as in the Readme:

-rw------- 1 zabbix zabbix 2455 Jan 17 07:09 zb_id_rsa
-rw-r--r-- 1 zabbix zabbix  567 Jan 17 07:09 zb_id_rsa.pub

What could have I done wrong?

patricegautier commented 10 months ago

how about the .ssh directory permissions? The zabbix needs r and x I think..

heremansgeert commented 10 months ago

I found a thread on Stackoverflow suggestion that the location of the file could be a problem.

After running the command from within the directory:

sudo -u zabbix ssh zb_id_rsa -i yourUserName@oneOfYourUnifiDevices

Confirming that this indeed worked. I move the files to a folder I created /var/lib/zabbix. After using this location everything started working.