You can login to a remote Linux server without entering password in 3 simple steps using ssky-keygen and ssh-copy-id as explained in this article.

ssh-keygen creates the public and private keys. ssh-copy-id copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys.

This article also explains 3 minor annoyances of using ssh-copy-id and how to use ssh-copy-id along with ssh-agent.

Step 1: Create public and private keys using ssh-key-gen on local-host

Create the username, password for logging into the Nagios interface.

# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

# ls -l /usr/local/nagios/etc/htpasswd.users

My hunch it that you should be able to overwrite the existing file with this – or you could look at it first, but I’m pretty sure it’ll not contain any clear text passwords (only hashes)… If the file’s not where it’s supposed to be, try whereis nagios or which nagios.

The recipe continues like this:
Make it available for the user who runs httpd.

# chmod o+r /usr/local/nagios/etc/htpasswd.users

Restart the httpd service.

# service httpd restart

I strongly advise you handle this suggestion with extreme care! I explicitly refuse any kind of responsibility! I’m no expert. I’d use this as a last resort; please be aware that you can cripple your Nagios installation this way (if the password file gets botched instead of overwritten, Nagios might refuse to run). It may be a good idea to talk to the Nagios people directly.