SSH key: '/root/.ssh/id_rsa' Error

Marc Powell marc at ena.com
Mon Apr 4 00:34:43 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of vivek sharma sharma
> Sent: Sunday, April 03, 2005 3:23 PM
> To: Arno Lehmann
> Cc: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] SSH key: '/root/.ssh/id_rsa' Error
> 


> For My second phase of Nagios Implementation:
> 
> I have configured push_check.sh to run plugins on remote machines::
> For this I have enabled ssh without passwd using RSA.
> 
> Now my command is:
> define command {
>                 command_name remote_procs_check
>                 command_line $USER1$/push_check.sh /root/.ssh/id_rsa
> XXX.XXX.XXX
> $USER1$/check_procs -w 2:2 -c 2:1024 -C flowd
>                 }
> 
> This command when run from command line gives proper output::
> [root at nagios libexec]# ./push_check.sh /root/.ssh/id_rsa XXX.XXX.XXX
> ./check_procs
> -w 1:2 -c 1:1024 -C flowd
> 
> PROCS OK: 2 processes with command name 'flowd'

This looks to be run as the root user. Have you tried running it as the
nagios user?

> 
> But when I see in Nagios GUI it gives the following error:
> ERROR: SSH key: '/root/.ssh/id_rsa' does not exist
> 
> I have placed the /root/.ssh/id_rsa.pub keys in the
> /root/.ssh/authorized_keys in the
> XXX.XXX.XXX host
> 
> What may be causing this?

You're not running nagios as root, are you? That would probably be a bad
idea. If not, it's highly unlikely that the nagios user can access
_anything_ under /root. If it can, that's bad as well. Generate a key as
the nagios user, add it to authorized_keys for the user you want to be
on the remote machine, try the command from your nagios machine as the
nagios user to accept the host identification (only needed once) and to
verify that the command runs as you expect.

> Also what is the difference between running it through nagios and
running
> it through command
> line as root.

Nagios user != root user. Root has global permissions to everything on
the file system, the nagios user doesn't (or shouldn't).

--
Marc


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list