Cacti password reset from Mysql not working

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Cacti password reset from Mysql not working

Post by arzoum »

Dear all,
please help me to reset admin password on Cacti

shell> mysql -u root -p
mysql> use cacti;
mysql> update user_auth set password=md5('admin') where username='admin';
Query OK, 1 row affected (0,00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

But I cannot connect via GUI with admin/admin.

Where is the issue please?
Thanks
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti password reset from Mysql not working

Post by netniV »

I would make sure that you are connecting Cacti to the correct DB. Also, if this is not on the login page with the cacti logo on it, then it may be Apache's user auth kicking in, or if it is, ensure that you do not have an LDAP domain that is being used.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Re: Cacti password reset from Mysql not working

Post by arzoum »

Dear Netvis
I think it is the correct DB used.
please see login page in attached. I don't know if it is Apache's user auth kicking or no.
LDAP domain is not used.

Thanks for your help.
Attachments
Capture1.JPG
Capture1.JPG (23.68 KiB) Viewed 18079 times
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Re: Cacti password reset from Mysql not working

Post by arzoum »

Hi,
please someone help me here?
Thanks
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti password reset from Mysql not working

Post by netniV »

If you look at the user_auth table, make sure you have the right username. Also, check in the settings table to see what the value is for auth_method
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Re: Cacti password reset from Mysql not working

Post by arzoum »

Dear Netvit
sorry for late,
auth_method doesn't exist in settings table. Should I add it please?
Thank
Attachments
Capture_mysql.JPG
Capture_mysql.JPG (13.03 KiB) Viewed 18013 times
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Re: Cacti password reset from Mysql not working

Post by arzoum »

All columns from settings table in attachment
Attachments
Capture_mysql_2.JPG
Capture_mysql_2.JPG (88.61 KiB) Viewed 18013 times
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti password reset from Mysql not working

Post by netniV »

Since Auth_Method is missing, the default is 1 which is the built in authentication of cacti. Can you do the following for me:

Code: Select all

select id, username, enabled, must_change_password, locked, failed_attempts, lastfail from user_auth;
+----+----------+---------+----------------------+--------+-----------------+----------+
| id | username | enabled | must_change_password | locked | failed_attempts | lastfail |
+----+----------+---------+----------------------+--------+-----------------+----------+
|  1 | admin    | on      |                      |        |               0 |        0 |
|  3 | guest    |         | on                   |        |               0 |        0 |
+----+----------+---------+----------------------+--------+-----------------+----------+
It should look something like above.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
arzoum
Posts: 11
Joined: Mon May 23, 2016 6:22 am

Re: Cacti password reset from Mysql not working

Post by arzoum »

mysql> select id, username, enabled, must_change_password from user_auth;
+----+--------------+---------+----------------------+
| id | username | enabled | must_change_password |
+----+--------------+---------+----------------------+
| 1 | admin | on | |
| 3 | guest | on | on |
| 4 | monitor | on | |

others columns don't exist.
--------------- Ubuntu 17.04 / Cacti 1.1.25 -------------------
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti password reset from Mysql not working

Post by netniV »

Is this a fresh install or an upgrade?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
HansGrundemann
Posts: 3
Joined: Tue Apr 28, 2020 11:10 am

Re: Cacti password reset from Mysql not working

Post by HansGrundemann »

Hi,

Is this problem solved back then?

I have the same issue her. I hav a new cacti installation on a brand new Raspbian Buster OS (Debian 10), MariaDB and Apache2.
Cannot find a solution anywhere. I get the login prompt, and the database connection is working because I get the login screen with the Cacti logo.

I've tried the methods in SLQ:

mysql -uroot -p
use cacti;
update user_auth set must_change_password="" where id=1;
update user_auth set password=md5('admin') where username='admin';
flush privileges;

But this does not work. The username looks like:
MariaDB [cacti]> select id, username, enabled, must_change_password from user_auth;
+----+----------+---------+----------------------+
| id | username | enabled | must_change_password |
+----+----------+---------+----------------------+
| 1 | admin | on | |
| 3 | guest | | on |
+----+----------+---------+----------------------+
2 rows in set (0.001 sec)


Does somebody knows what's the problem?
HansGrundemann
Posts: 3
Joined: Tue Apr 28, 2020 11:10 am

Re: Cacti password reset from Mysql not working

Post by HansGrundemann »

To my opinion the auth_method is available:

MariaDB [cacti]> select * from settings;
+------------------+------------------------------------------------------------------------------------------------------------+
| name | value |
+------------------+------------------------------------------------------------------------------------------------------------+
| auth_method | 1 |
| date | 2020-04-28 19:40:01 |
| path_webroot | /opt/cacti |
| poller_lastrun_1 | 1588095601 |
| selected_theme | modern |
| stats_poller | Time:298.9331 Method:cmd.php Processes:1 Threads:0 Hosts:0 HostsPerProcess:0 DataSources:0 RRDsProcessed:0 |
| stats_recache_1 | Poller:1 RecacheTime:0.0 DevicesRecached:0 |
+------------------+------------------------------------------------------------------------------------------------------------+
7 rows in set (0.001 sec)
HansGrundemann
Posts: 3
Joined: Tue Apr 28, 2020 11:10 am

Re: Cacti password reset from Mysql not working

Post by HansGrundemann »

This is (for me) the solution:

viewtopic.php?f=21&t=60850
Comment out cacti_cookie_domain in conf.php:
#$cacti_cookie_domain = 'cacti.net';
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti password reset from Mysql not working

Post by netniV »

HansGrundemann wrote: Tue Apr 28, 2020 1:43 pm This is (for me) the solution:

viewtopic.php?f=21&t=60850
Comment out cacti_cookie_domain in conf.php:
#$cacti_cookie_domain = 'cacti.net';
That is a different and very problematic issue with Cacti 1.2.11 only. Unfortunately, that variable was supposed to be commented out by default but was left uncommented and commited which ultimately released it to the world.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

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

Who is online

Users browsing this forum: No registered users and 2 guests