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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

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

Post 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.
bolson

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

Post 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,
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

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

Post by ikekim »

Thanks that worked great.
But why not have your command in the document?

ik
bolson

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

Post by bolson »

I've sent the issue to our documentation team.

May we close this topic?
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

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

Post by ikekim »

Yes, please close.

many thanks!

ik
bolson

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

Post by bolson »

Closing this topic as resolved.

Thank you for visiting the Nagios Support Forum!
Locked