2

How can i reset the password for the user admin with MySQL or a Observium script.

MariaDB [observium]> select * from users;
+---------+----------+------------------------------------+----------+-------+-------+-------+-------------------+--------------+
| user_id | username | password                           | realname | email | descr | level | can_modify_passwd | user_options |
+---------+----------+------------------------------------+----------+-------+-------+-------+-------------------+--------------+
|       1 | admin    | $1$abcdefgh$jklmnopqrstuvwxyzabcd. |          |       |       |    10 |                 1 | NULL         |
+---------+----------+------------------------------------+----------+-------+-------+-------+-------------------+--------------+
1 row in set (0.00 sec)

2 Answers 2

3

Look like it MD5 (1) hash with salt (abcdefgh).

openssl passwd -1 build new hash from plain password

You can use it to update users table.

You can try build Mysql-only solution based on https://stackoverflow.com/questions/5903702/md5-and-salt-in-mysql

But salt must be cryptographic quality random for secyrity.

UPD.

Blackbox Hacking solution. Copy password field from other user with known password, event from different instance of observium. It work 99%

6
  • 1
    it does not work: UPDATE users SET password = MD5('abcdefgh' + ':' + 'newPassword') WHERE user_id = 1; i cant login with "newPassword"
    – FaxMax
    Apr 12, 2018 at 11:44
  • It question which algorythm used to build hash with salt. At first try standard openssl passwd -1 it make different value
    – mmv-ru
    Apr 12, 2018 at 12:07
  • Yes i tried openssl passwd -1, but i get differ results with the same password
    – FaxMax
    Apr 12, 2018 at 12:28
  • 1
    For debug is possible to force using specific salt openssl passwd -1 -salt abcdefgh , but it insecure for production.
    – mmv-ru
    Apr 12, 2018 at 12:40
  • 1
    i could not login, because i limited the ip access: SELECT config_value FROM config WHERE config_key = 'web_session_cidr';
    – FaxMax
    Apr 18, 2018 at 13:52
3

this might help someone. as it just worked for me as long as you have root access to the server

cd /opt/observium
./adduser.php admin <CLASS_PASSWORD> 10

once the new user with the same level of permission is active you can then update the other users password

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .