My other staff ask me password for username admin. Yes, its administrator level in cacti.
After hardy trying to remember I gave up, I decide to reset it to other value but how?
I try to find out using database approach :
Here’s my steps :
1. Checking for cacti location and see db setting.
monitor# pwd
/usr/local/share/cacti/include
see setting dbnya.
monitor# cat db-settings.php
<?php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
?>
2. Enter database with information taken from db-settings.php information.
monitor# mysql -ucacti -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8343
Server version: 5.0.45 FreeBSD port: mysql-server-5.0.45_1
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
mysql> use cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from auth_user;
ERROR 1146 (42S02): Table ‘cacti.auth_user’ doesn’t exist
Ups, my bad 🙂
mysql> select * from user_auth;
+—-+———-+————-
| id | username | password
+—-+———-+————-
| 1 | admin | 7a40008b8368b684bec2286db1b073e
| 3 | monitor | 719daab8833968dc805a345c58545ea
| 7 | crash | ac43724f16e9241d990427ab7c8f422
+—-+———-+————-
3 rows in set (0.00 sec)
mysql>exit
3. Generate new password with md5 utility.
monitor# md5 -s mypassword
MD5 ("mypassword") = 34819d7beeabb9260a5c854bc85b3e4
4. Update database value with new created password string.
monitor# mysql -ucacti -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8344
Server version: 5.0.45 FreeBSD port: mysql-server-5.0.45_1
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
mysql> update auth_user set password=’34819d7beeabb9260a5c8
54bc85b3e44′ where username=’admin’
done 🙂