Page 1 of 1

ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error hostname

Posted: Tue Aug 22, 2017 2:36 pm
by ikekim
I have Nagios XI installed (Virtual Box & import image)and want to monitor remote Redhat 7.x machine using SSH. Installing the agent is likely not allowed in our environment.

This is from Nagios instruction from page 3: https://assets.nagios.com/downloads/nag ... ng_SSH.pdf

For the called check_by_ssh to work you must now copy the public key file of the nagios user on the Nagios XI server to the
authorized_keys file for the nagios user on the remote Linux/Unix server. Continuing with the terminal session from the previous
step execute the following command:

ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip

So when I use this command, using the remote ip address, but I get an error message "ssh: could not resolve hostname /home/nagios/.ssh/id_rsa.pub: Name or service not known."

However, I can ssh to this target host using the ip address from Nagios XI server and successfully logon using the user account "nagios".

What is causing this error?


thanks.

Re: ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error host

Posted: Tue Aug 22, 2017 3:00 pm
by bolson
Execute the command like this:

Code: Select all

ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@remoteip
Let us know if this resolves your issue,

Re: ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error host

Posted: Tue Aug 22, 2017 3:06 pm
by ikekim
Thanks that worked great.
But why not have your command in the document?

ik

Re: ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error host

Posted: Tue Aug 22, 2017 3:08 pm
by bolson
I've sent the issue to our documentation team.

May we close this topic?

Re: ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error host

Posted: Tue Aug 22, 2017 3:39 pm
by ikekim
Yes, please close.

many thanks!

ik

Re: ssh-copy-id ~/.ssh/id_rsa.pub nagios@remoteip error host

Posted: Tue Aug 22, 2017 3:42 pm
by bolson
Closing this topic as resolved.

Thank you for visiting the Nagios Support Forum!