ambari-admin-password-reset : say command not found.
How to reset ambari admin password?
Do we need to run from any particular directory / path ?
we are running Ambari Version 126.96.36.199
I have seen couple of links where they set ambari password from mysql . Is it true?
The "ambari-admin-password-reset" command is available only with the HDP sandbox. So if you are using HDP sandbox then only you will get this command available at the following location "/usr/sbin/ambari-admin-password-reset"
If you are using Sandbox then you should make sure that you login to the Sandbox using SSH on specific port 2222 as following to access the command:
# ssh email@example.com -p 2222 # which /usr/sbin/ambari-admin-password-reset /usr/sbin/ambari-admin-password-reset
If you are using Sandbox then as an alternate approach you can also try accessing the web terminal and run the commands on the browser shell, (Open the sandbox hostname with port 4200 on web browser).
Jay, I am not your HDP Sand Box. These are all our production bare metal servers. Any suggest please? Thanks JJ
The "ambari-admin-password-reset" command is available only with the HDP sandbox.
As you are running your production servers so in that case you have two options to reset the admin password:
1. If you already know the admin password then you can reset the password from ambari admin UI.
Ambari UI --> Login with Old credentials --> Manage Ambari --> Users --> Click on "admin" user --> click on "Change Password" button.
2. If you do not remember the existing admin password then you can directly reset the admin password from the ambari Database by running the following SQL query on the ambari database.
update ambari.users set user_password='538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00' where user_name='admin'
Above SQL query will reset the ambari admin user (admin) password to "admin". Then restart the ambari-server then you should be able to login to ambari using username: admin and password: admin. (Making changes to the DB requires ambari server to be restarted to get the changes reflected).
I am using mysql database , but i don't see database user with the name "admin". I see "ambari" user. But from ambari web ui , i am accessing as "admin" user . Do you know why.
mysql> select db 'DATABASE', host HOST, user USER from mysql.db where db = 'ambari';
| DATABASE | HOST | USER |
| ambari | % | ambari |
1 row in set (0.00 sec)
You are looking at incorrect table.
Please login to the ambari DB. Inside the Database name "ambari" you will find the "users" table.
# mysql -u ambari -p ambari Enter Database Password: bigdata mysql> use ambari; ambari> select * from ambari.users; ambari> update ambari.users set user_password='538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00' where user_name='admin';
I am not your HDP Sand Box. These are all our production bare metal servers. Any suggest please?