[SOLVED] Permission Denied to Cacti GUI

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
vpatel
Posts: 9
Joined: Mon Nov 05, 2018 1:16 pm

[SOLVED] Permission Denied to Cacti GUI

#1 Post by vpatel » Wed Dec 05, 2018 2:14 pm

Hi Team,

My cacti version is currently 1.1.37 which is up to date. It was working fine but suddenly stopped working and gave me permission denied while I was bulk copying admin user. Can you please guide me?

It shows below:

Permission Denied
You are not permitted to access this section of Cacti.

If you feel that this is an error. Please contact your Cacti Administrator.

[Return | Login Again]
Version 1.1.37 | (c) 2004-2018 - The Cacti Group

Viral
Attachments
Capture.PNG
error_snapshot
Capture.PNG (67.71 KiB) Viewed 521 times

netniV
Cacti Guru User
Posts: 2808
Joined: Sun Aug 27, 2017 12:05 am

Re: Permission Denied to Cacti GUI

#2 Post by netniV » Thu Dec 06, 2018 6:48 am

There is a bug where you can define the admin user as a template user, which then disables the admin user. Run the following for me to see if that's been hit (otherwise it's really a permissions issue where you've locked yourself out somehow).

Code: Select all

select id, username, realm, must_change_password, password_change, login_opts, enabled, locked from user_auth;
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
| id | username | realm | must_change_password | password_change | login_opts | enabled | locked |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
|  1 | admin    |     0 |                      | on              |          2 | on      |        |
|  3 | guest    |     0 | on                   | on              |          1 |         |        |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
2 rows in set (0.00 sec)
On a fresh system, you should have a table like above.

vpatel
Posts: 9
Joined: Mon Nov 05, 2018 1:16 pm

Re: Permission Denied to Cacti GUI

#3 Post by vpatel » Thu Dec 06, 2018 8:58 am

Thanks netniV for the response. here's the output. Seems like I am locked out pretty much. I copied admin user to Viral using cli to see response but it is locked out as well. Please guide.

Code: Select all


MariaDB [cacti]> select id, username, realm, must_change_password, password_change, login_opts, enabled, locked from user_auth;
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
| id | username | realm | must_change_password | password_change | login_opts | enabled | locked |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
|  1 | admin    |     0 |                      | on              |          2 | on      |        |
|  4 | support  |     0 |                      | on              |          3 | on      |        |
|  5 | viral    |     0 |                      | on              |          2 | on      |        |
+----+----------+-------+----------------------+-----------------+------------+---------+--------+
3 rows in set (0.00 sec)

Regards,
Viral

netniV
Cacti Guru User
Posts: 2808
Joined: Sun Aug 27, 2017 12:05 am

Re: Permission Denied to Cacti GUI

#4 Post by netniV » Fri Dec 07, 2018 6:22 am

Code: Select all

select * from user_auth_realm where user_id = 1;
+----------+---------+
| realm_id | user_id |
+----------+---------+
|        1 |       1 |
|        2 |       1 |
|        3 |       1 |
|        4 |       1 |
|        5 |       1 |
|        7 |       1 |
|        8 |       1 |
|        9 |       1 |
|       10 |       1 |
|       11 |       1 |
|       12 |       1 |
|       13 |       1 |
|       14 |       1 |
|       15 |       1 |
|       16 |       1 |
|       17 |       1 |
|       18 |       1 |
|       19 |       1 |
|       20 |       1 |
|       21 |       1 |
|       22 |       1 |
|       23 |       1 |
|       24 |       1 |
|       25 |       1 |
|       26 |       1 |
If you run the above, your admin account should have at least the first 26 realms. I do wonder if you copied the users the wrong way around, thus it removed your privs rather than granting them to the other user.

vpatel
Posts: 9
Joined: Mon Nov 05, 2018 1:16 pm

Re: Permission Denied to Cacti GUI

#5 Post by vpatel » Fri Dec 07, 2018 8:27 am

Seems like have no privs at all to user. How can i assign them?

Code: Select all


MariaDB [cacti]> select * from user_auth_realm where user_id = 1;
Empty set (0.00 sec)

Thanks,
Viral

vpatel
Posts: 9
Joined: Mon Nov 05, 2018 1:16 pm

Re: Permission Denied to Cacti GUI

#6 Post by vpatel » Fri Dec 07, 2018 8:27 am

Seems like have no privs at all to user. How can i assign them?

Code: Select all


MariaDB [cacti]> select * from user_auth_realm where user_id = 1;
Empty set (0.00 sec)

Thanks,
Viral

vpatel
Posts: 9
Joined: Mon Nov 05, 2018 1:16 pm

Re: Permission Denied to Cacti GUI

#7 Post by vpatel » Fri Dec 07, 2018 9:26 am

I figured out. For anyone facing same issue, below command resolved authority issue for admin user.

Code: Select all

MariaDB [cacti]> INSERT INTO user_auth_realm (`realm_id`, `user_id`) values ('1', '1');
and so on upto realm_id=26.

Note that the column names are enclosed in ` (character above tab) and not in quotes

Thanks a bunch netniV for resolution. Have a good day!

Viral

netniV
Cacti Guru User
Posts: 2808
Joined: Sun Aug 27, 2017 12:05 am

Re: Permission Denied to Cacti GUI

#8 Post by netniV » Mon Dec 10, 2018 6:50 am

Sorry, had a busy weekend so didn't checkin here. But you figured out the required commands so that's cool.

Post Reply