Support Questions

Find answers, ask questions, and share your expertise

Unable to login in ranger admin console | CDP 7.1.7

avatar
Contributor

Hello Team,

I have CDP Setup on premise and I am unable to login in ranger admin console.
Details
CDP: 7.1.7 | CM : 7.6.5 | Non Kerberised | Database : Mysql for all services


I have tried all the below ways
https://cloudera.ericlin.me/2020/02/how-to-update-ranger-web-ui-admin-users-password/

https://community.cloudera.com/t5/Support-Questions/Ranger-Password-reset/m-p/280992


In my case table: x_portal_user under ranger database was empty set.
SO I manually inserted values for fields
insert into x_portal_user(id,first_name,login_id,password,status) values(1,'Admin','admin','ceb4f32325eda6142bd65215f4c0f371',1);
With the above query it got inserted into table. Then did FLUSH PRIVILEGES , commit steps in mysql database.

Also tried further insert one more insert statement like above.


On Ranger Side configuration:
I have disable kerberos
Admin Authentication Method: Unix


Please help/suggest with the solution. Thanks

4 REPLIES 4

avatar
Master Mentor

@dmharshit 

To resolve this issue, you will have to update Ranger’s backend database directly to reset the password you will need to write access to Ranger’s backend database.

 

Using MySQL you know how to log into MySQL from either the command line 

The users who can access Ranger’s Admin Web UI, also call Portal, are stored in a 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)

Query this table to confirm your Admin user is present in the table:

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)

The password corresponds to the hashed value of “fdea9c9f5fabb9c4120b9834684f0ff0”,  reset it to default value of “admin”, which has the hash value of “ceb4f32325eda6142bd65215f4c0f371”. Please run the 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.

Hope that helps
Geoffrey

avatar
Contributor

@Shelton updating the password option for x_portal_user table option --->This option I have already tried after inserting the values in empty set. But its in my case its not working

avatar
Master Mentor

@dmharshit 

The 2 SQL inserts are not identical the latter only updates the password while the former user and password.

Prior to your update did your backup the table?

Geoffrey

 

avatar
Contributor

Hi @dmharshit 

In case you have empty x_portal_user table, you can re-init your db with ranger init script "range_core_db_<db-type>.sql"

Here is example command for mysql:

$ mysql -h hostname -u user ranger < `locate ranger_core_db_mysql.sql`


Restart Ranger then login with admin/admin.