It happens often that user can forget their password to be used when logging into Ranger’s Admin Web UI. If you can contact your Ranger Admin to update password for you, that’s fine. But what about when the “admin” user’s password is also forgotten? Then you will be logged out completely.

To resolve this issue, we have to update Ranger’s backend database directly to reset password. To do so, we need to have at least write access to Ranger’s backend database.

In my case, I am using MySQL, as it is most populate RDBMS in the industry. I assume that you know how to log into MySQL from either command line or a GUI interface like phpMyAdmin or other 3rd party tools.

The users who can access Ranger’s Admin Web UI, also call Portal, are stored in table called “x_portal_user“.

mysql> show tables;
+------------------------------+
| Tables_in_ranger             |
+------------------------------+
| vx_trx_log                   |
| x_access_type_def            |
....
| x_portal_user                |
| x_portal_user_role           |
...
+------------------------------+
67 rows in set (0.00 sec)

You can query this table to confirm your Admin user is present in the table, in my case is “admin”:

mysql> SELECT id, first_name, last_name, login_id, password, status \
FROM x_portal_user WHERE login_id = 'admin';
+----+------------+-----------+----------+----------------------------------+--------+
| id | first_name | last_name | login_id | password                         | status |
+----+------------+-----------+----------+----------------------------------+--------+
|  1 | Admin      |           | admin    | fdea9c9f5fabb9c4120b9834684f0ff0 |      1 |
+----+------------+-----------+----------+----------------------------------+--------+
1 row in set (0.00 sec)

As I can’t remember what password corresponded to hashed value of “fdea9c9f5fabb9c4120b9834684f0ff0”, we can reset to default value of “admin”, which has the hash value of “ceb4f32325eda6142bd65215f4c0f371”. Please run below query:

UPDATE x_portal_user SET password = 'ceb4f32325eda6142bd65215f4c0f371' 
WHERE login_id = 'admin';

After that, just log into Ranger Web UI using “admin” as username and “admin” as password, then update the password IMMEDIATELY through web UI.

Now, you should not fear of losing your Admin password anymore.

Please refer to discussions in Cloudera Community Portal here.

Leave a Reply

Your email address will not be published. Required fields are marked *