Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Dec 15, 2018 11:57 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [SOLVED] Permission Denied to Cacti GUI
PostPosted: Wed Dec 05, 2018 2:14 pm 
Offline

Joined: Mon Nov 05, 2018 1:16 pm
Posts: 8
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:
File comment: error_snapshot
Capture.PNG
Capture.PNG [ 67.71 KiB | Viewed 52 times ]
Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Thu Dec 06, 2018 6:48 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1818
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 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.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Thu Dec 06, 2018 8:58 am 
Offline

Joined: Mon Nov 05, 2018 1:16 pm
Posts: 8
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:

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


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Fri Dec 07, 2018 6:22 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1818
Code:
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.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Fri Dec 07, 2018 8:27 am 
Offline

Joined: Mon Nov 05, 2018 1:16 pm
Posts: 8
Seems like have no privs at all to user. How can i assign them?

Code:

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



Thanks,
Viral


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Fri Dec 07, 2018 8:27 am 
Offline

Joined: Mon Nov 05, 2018 1:16 pm
Posts: 8
Seems like have no privs at all to user. How can i assign them?

Code:

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



Thanks,
Viral


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Fri Dec 07, 2018 9:26 am 
Offline

Joined: Mon Nov 05, 2018 1:16 pm
Posts: 8
I figured out. For anyone facing same issue, below command resolved authority issue for admin user.

Code:
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


Top
 Profile  
 
 Post subject: Re: Permission Denied to Cacti GUI
PostPosted: Mon Dec 10, 2018 6:50 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1818
Sorry, had a busy weekend so didn't checkin here. But you figured out the required commands so that's cool.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group