Cannot create new user

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bdoyd1e990
Posts: 12
Joined: Wed Oct 11, 2017 2:57 am

Cannot create new user

Post by bdoyd1e990 »

I am running nagios core 4.3.2 on a Red hat 7 server,
And I wanted to create a read-only user for the web gui, I added a user to htpasswd.users

and added the username as below into cgi.cfg

Code: Select all

[root@n0lnagp01 nagios]# grep nagiosview cgi.cfg
authorized_for_all_services=nagiosadmin,nagiosview
authorized_for_all_hosts=nagiosadmin,nagiosview
authorized_for_read_only=nagiosview
I've tried restarting httpd & nagios
and even tried a reboot in case there were other processes than need restarting.
But my new user doesn't seem to be getting created, as from the httpd error_log i get this error

Code: Select all

[root@n0lnagp01 nagios]# grep nagiosview --color /var/log/httpd/error_log
[Fri Jan 26 12:01:00.588984 2018] [auth_basic:error] [pid 33630] [client 10.60.147.113:59438] AH01618: user nagiosview not found: /nagios
And If i try to change the nagiosadmin password using htpasswd ./htpasswd.users nagiosadmin it doesn't get changed,
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cannot create new user

Post by dwhitfield »

bdoyd1e990 wrote:I
And If i try to change the nagiosadmin password using htpasswd ./htpasswd.users nagiosadmin it doesn't get changed,
Do you get any errors when trying to change the nagiosadmin password? Ultimately if you aren't able to change the password of an apache account, that sounds like an apache problem, not a nagios problem but we can certainly do some digging.
bdoyd1e990
Posts: 12
Joined: Wed Oct 11, 2017 2:57 am

Re: Cannot create new user

Post by bdoyd1e990 »

No i'm not getting any errors when i try to change the nagiosadmin account
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cannot create new user

Post by dwhitfield »

What's the output of ll /usr/local/nagios/etc/htpasswd.users?

What version of apache are you using?
bdoyd1e990
Posts: 12
Joined: Wed Oct 11, 2017 2:57 am

Re: Cannot create new user

Post by bdoyd1e990 »

My htpasswd file is in a different location, so here is the requested info

Code: Select all

[root@n0lnagp01 ~]# ll /etc/nagios/htpasswd.users
-rw-r--r--. 1 root root 99 Jan 26 12:00 /etc/nagios/htpasswd.users


[root@n0lnagp01 ~]# httpd -v
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built:   Mar  8 2017 05:09:47
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Cannot create new user

Post by scottwilkerson »

bdoyd1e990 wrote:My htpasswd file is in a different location, so here is the requested info

Code: Select all

[root@n0lnagp01 ~]# ll /etc/nagios/htpasswd.users
-rw-r--r--. 1 root root 99 Jan 26 12:00 /etc/nagios/htpasswd.users


[root@n0lnagp01 ~]# httpd -v
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built:   Mar  8 2017 05:09:47
Did you add the user to this file?

Code: Select all

htpasswd /etc/nagios/htpasswd.users nagiosview
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bdoyd1e990
Posts: 12
Joined: Wed Oct 11, 2017 2:57 am

Re: Cannot create new user

Post by bdoyd1e990 »

Yes I added the user to the correct file,
Although I've found my issue.

I do feel a bit stupid as I missed where the filename is specified as passwd.users not htpasswd.users in httpd.conf
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cannot create new user

Post by dwhitfield »

bdoyd1e990 wrote: Although I've found my issue.
Great news! Are we ready to lock this one up?
bdoyd1e990
Posts: 12
Joined: Wed Oct 11, 2017 2:57 am

Re: Cannot create new user

Post by bdoyd1e990 »

Yes this can be locked
Locked