How can I reset the admin password in Datastax Opscenter? Will disabling and reenabling authentication in /etc/opscenter/opscenterd.conf do the trick? Will I lose any other data in the process?
2 Answers
I'm not aware of an official way to simply reset the admin password in OpsCenter. However, I do know of a "hacky" way to do it, if you're up for that (and if you have physical or ssh access to the server).
OpsCenter's user authentication is maintained in a SQLite database file named passwd.db
, located in the root of your OpsCenter directory. The file is created once you enable user authentication in OpsCenter. Using sqlite3, you can open and manage this file:
$ sqlite3 passwd.db
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> PRAGMA table_info(users);
0|id|INTEGER|0||1
1|username|TEXT|0||0
2|password|TEXT|0||0
3|groupid|INTEGER|0||0
sqlite> SELECT * FROM users;
1|admin|8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918|1
Looking above, you can see the row for the "admin" user of a brand new install of OpsCenter 5.2.1 is the hash of:
8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
If you update the password field on the users table to that value, it should reset it back to the original:
UPDATE users
SET password='8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918'
WHERE username='admin';
I don't know if the passwords on different versions of OpsCenter use the same hash or not, but this should work if you're using OpsCenter 5.2.1. Otherwise, if you have a user in there that you do know the password to, you can (look up and) set the admin password to that hash, and then at least you'll know the password and be able to log in.

- 55,518
- 11
- 116
- 132
-
BTW- I'm almost positive that DataStax support would not approve of this method, so use at your own risk. – Aaron May 01 '16 at 23:29
-
1That's a clever idea, and I almost went with it, but since we didn't need to keep any of the other user IDs on the system all I needed to do to reset the admin username was remove the passwd.db file. – Jon Buys May 03 '16 at 01:29
Turns out this was fairly simple. All I needed to do was stop OpsCenter, rename (or remove) passwd.db, and restart OpsCenter again. The daemon automatically creates a new password db file and sets the admin password to 'admin'.

- 507
- 5
- 15