Nagios 3.4.4 / Ubuntu Server / Permission denied to htpasswd
Nagios 3.4.4 / Ubuntu Server / Permission denied to htpasswd
I compiled form source and everything checked out fine though I can not get past the login.
apache error.log has...
Permission denied: Could not open password file: /usr/local/nagios/etc/htpasswd.users
/usr/local/nagios folder permissions
drwxr-xr-x 12 root root 4096 Mar 7 09:23 nagios.
Not sure the correct way to resolve this issue.
Any help would be much appreciated.
apache error.log has...
Permission denied: Could not open password file: /usr/local/nagios/etc/htpasswd.users
/usr/local/nagios folder permissions
drwxr-xr-x 12 root root 4096 Mar 7 09:23 nagios.
Not sure the correct way to resolve this issue.
Any help would be much appreciated.
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
What are the permissions on the htpasswd.users file itself?
Code: Select all
ls -la /usr/local/nagios/etc/htpasswd.usersFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
-rw-r----- 1 nagios nagcmd 50 Mar 8 08:27 /usr/local/nagios/etc/htpasswd.users
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
root@IT7:/etc/apache2# ls -la /usr/local/nagios/etc/htpasswd.users
-rw-r----- 1 nagios nagcmd 50 Mar 8 08:27 /usr/local/nagios/etc/htpasswd.users
-rw-r----- 1 nagios nagcmd 50 Mar 8 08:27 /usr/local/nagios/etc/htpasswd.users
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
Try:
Code: Select all
chmod o+r /usr/local/nagios/etc/htpasswd.usersFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
Thank you so much that solved my issue.
I'm new to nagios and linux. Can you tell me what that command did to fix the issue?
I'm new to nagios and linux. Can you tell me what that command did to fix the issue?
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
chmod changes permissions on files/directories. The htpasswd.users file is owned by user "nagios" and group "nagcmd". But apache needs to be able to read the file as well, as it is used to authenticate your web interface user in nagios' web frontend. Originally, your file had read/write access for user "root", read access for user "nagios", and no permissions for anything else. You can tell this by the line:
Where:
111 is "root" permissions, 222 is "user", and 333 is "other". Each of these triplets are "rwx" where "r" is read, "w" is write, and "x" is execute.
Apache needs to be able to read the file to authenticate your user login against it. So the "other" portion of the file permissions needs to have read access. To break down the command:
"o+r" essentially gives anybody that does not own the file, "other" or "o", read or "r" access. That is why "chmod o+r" gives "others" permission to read the file.
After running the command, your file permission should resemble:
Notice the additional "r" in the "others" triplet?
For more information: http://linux.about.com/od/commands/l/blcmdl1_chmod.htm
Does this help?
Code: Select all
-rw-r-----Code: Select all
-111222333Apache needs to be able to read the file to authenticate your user login against it. So the "other" portion of the file permissions needs to have read access. To break down the command:
Code: Select all
chmod o+r /usr/local/nagios/etc/htpasswd.usersAfter running the command, your file permission should resemble:
Code: Select all
-rw-r--r-- 1 root root 50 Dec 3 13:40 /usr/local/nagios/etc/htpasswd.usersFor more information: http://linux.about.com/od/commands/l/blcmdl1_chmod.htm
Does this help?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
I admit I needed to read your explanation a few times but it has sunk in.
I was looking at adding www-data user to the nagios group thinking that would resolve the issue but was not sure about this move and knew it probably wasn't the correct way to fix this.
I was looking at adding www-data user to the nagios group thinking that would resolve the issue but was not sure about this move and knew it probably wasn't the correct way to fix this.
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
No problem. You will find many conventions like this one that are nearly "universal* among posix based unix/linux systems. That is one of the advantages of *nix as once you become comfortable with one distribution's command line interface (bash most of the time), most of your knowledge is transferable over to another *nix versions. (technically, you are becoming apt at using GNU utilities, but that is a contextual war for recognition that has been fought by the GNU guys for ages).
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios 3.4.4 / Ubuntu Server / Permission denied to htpa
Actually in this case it would not have resolved the issue, as the owner(nagios) and owning group(nagcmd) would not be the same as the nagios group. However if you were to add the www-data user to nagcmd, it would have resolved it. But as you thought, not an ideal solution without knowing what else that may give the www-data user permissions to.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.