Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Reset Ambari admin password

avatar
Expert Contributor

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

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Sanaz Janbakhsh

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

View solution in original post

11 REPLIES 11

avatar
Master Mentor

@Sanaz Janbakhsh

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".

avatar
Super Collaborator
@Sanaz Janbakhsh

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'

avatar
Expert Contributor

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

avatar
Super Collaborator

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.

avatar
Master Mentor

@Sanaz Janbakhsh

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

avatar
Expert Contributor

looks like it is set correctly but i cannot login !!!

user_name | user_password -----------+--------------- admin | admin (1 row)

SJ

avatar
Expert Contributor

as you can see the password stored as "admin" and not 538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00"

avatar
Master Mentor

@Sanaz Janbakhsh

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.

12907-ambari-admin-password.png

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

avatar
Expert Contributor

I Just ran the same query that you sent me, not sure what steps did i miss?

SJ