Created 02-24-2017 05:51 AM
Hi,
I've launched HDP 2.5 on an AWS instance, for some reason i cannot login to admin. I wanted to reset the admin ambari password, i tried "ambari-admin-password-reset" but looks like it is for sandbox and it cannot found on the server.
Please advise how can I reset the password.
Thanks,
SJ
Created 02-24-2017 06:11 AM
Looks like you have missed few characters in the admin password. Can you please share the output of the following query?
Select user_name, user_password from ambari.users where user_name='admin';
.
Resulted password should be exactly
538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00
Created 02-24-2017 05:53 AM
On ambari Database you can run the folllowing command:
update ambari.users set user_password='538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00' where user_name='admin';
.
This will reset ambari user "admin" password as "admin".
Created 02-24-2017 05:56 AM
In sandbox ambari-admin-password-reset should work. You can also reset password from DB.
-->From Ambari server host 'psql -U ambari ambari' (password 'bigdata')
--> In psql:
update ambari.users set user_password='538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00' where user_name='admin'
-->Quit psql
-->Run 'ambari-server restart'
Created 02-24-2017 06:02 AM
Thanks,
I applied it and it gave me an server error , when i looked at the log i can find below. Any advice?
24 Feb 2017 01:01:41,275 WARN [ambari-client-thread-28] ServletHandler:561 - Error Processing URI: /api/v1/users/admin - (java.lang.IllegalArgumentException) Hex-encoded string must have an even number of characters 24 Feb 2017 01:01:41,275 WARN [ambari-client-thread-28] ServletHandler:561 - Error Processing URI: /api/v1/users/admin - (java.lang.IllegalArgumentException) Hex-encoded string must have an even number of characters
Created 02-24-2017 06:09 AM
It looks that user_password is not set correctly. Can you make sure that there is no special characters included in password. Or set it again, dont copy paste from above, instead copy to notepad and make sure no specail characters included in the command before executing it on sandbox.
Created 02-24-2017 06:11 AM
Looks like you have missed few characters in the admin password. Can you please share the output of the following query?
Select user_name, user_password from ambari.users where user_name='admin';
.
Resulted password should be exactly
538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00
Created 02-24-2017 06:14 AM
looks like it is set correctly but i cannot login !!!
user_name | user_password -----------+--------------- admin | admin (1 row)
SJ
Created 02-24-2017 06:21 AM
as you can see the password stored as "admin" and not 538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00"
Created on 02-24-2017 06:22 AM - edited 08-19-2019 03:16 AM
The password i see in your output is not encrypted. Ambari uses Spring Security mechanism. And the password "admin" is stored in the database in encrypted manner. So in your database the password should be in encoded format.
So once you have the above mentioned entry in your ambari DB (users) table then after restarting ambari server you should be able to login to ambari UI using
username: admin
password: admin
Created 02-24-2017 06:23 AM
I Just ran the same query that you sent me, not sure what steps did i miss?
SJ