<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to programmatically change Ambari admin password? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131033#M47619</link>
    <description>&lt;P&gt;I am working on automating the installation and provisioning of clusters, which includes installing Ambari and using a Blueprint via the API.  This is all working fine, but I have one more thing which I'm having trouble with, and that is changing the Ambari password during the overall provisioning process (I'm referring to my process here, not the Ambari cluster creation process).  What I do NOT want is to leave newly provisioned Ambari installs sitting around with the default "admin/admin" credentials, and I also can't have a human going in to change this every time.  &lt;/P&gt;&lt;P&gt;I've tried the REST API, but even though the call appears to execute correctly (eg, no errors are returned), the new password never takes effect.  &lt;/P&gt;&lt;P&gt;I thought about using the ambari-admin-password-reset command via ssh, but my Ambari install (using 2.1.0) doesn't appear to have that command. I've double checked that the agent is running, and I've tried it as the root user, and in every case, it yields a "command not found" error.&lt;/P&gt;&lt;P&gt;I also thought about using JDBC, connecting directly to Postgres, and munging the password directly, but I'm not sure which hash algorithm Ambari uses, and/or where it stores the salt (if one is used).  &lt;/P&gt;&lt;P&gt;If anyone can provide any advice on how to make any or all of these approaches work, it would be greatly appreciated.  Right now I'm about to tear my last hair out fighting with this. &lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2016 18:29:32 GMT</pubDate>
    <dc:creator>motley_crue_fan</dc:creator>
    <dc:date>2016-11-30T18:29:32Z</dc:date>
    <item>
      <title>How to programmatically change Ambari admin password?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131033#M47619</link>
      <description>&lt;P&gt;I am working on automating the installation and provisioning of clusters, which includes installing Ambari and using a Blueprint via the API.  This is all working fine, but I have one more thing which I'm having trouble with, and that is changing the Ambari password during the overall provisioning process (I'm referring to my process here, not the Ambari cluster creation process).  What I do NOT want is to leave newly provisioned Ambari installs sitting around with the default "admin/admin" credentials, and I also can't have a human going in to change this every time.  &lt;/P&gt;&lt;P&gt;I've tried the REST API, but even though the call appears to execute correctly (eg, no errors are returned), the new password never takes effect.  &lt;/P&gt;&lt;P&gt;I thought about using the ambari-admin-password-reset command via ssh, but my Ambari install (using 2.1.0) doesn't appear to have that command. I've double checked that the agent is running, and I've tried it as the root user, and in every case, it yields a "command not found" error.&lt;/P&gt;&lt;P&gt;I also thought about using JDBC, connecting directly to Postgres, and munging the password directly, but I'm not sure which hash algorithm Ambari uses, and/or where it stores the salt (if one is used).  &lt;/P&gt;&lt;P&gt;If anyone can provide any advice on how to make any or all of these approaches work, it would be greatly appreciated.  Right now I'm about to tear my last hair out fighting with this. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 18:29:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131033#M47619</guid>
      <dc:creator>motley_crue_fan</dc:creator>
      <dc:date>2016-11-30T18:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically change Ambari admin password?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131034#M47620</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/14621/motleycruefan.html"&gt;Phillip Rhodes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- Suppose "joy" users password was earlier "joy123"  and i want to change it to "joy321" then i would do the following.&lt;/P&gt;&lt;PRE&gt;curl -i -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"Users": { "user_name": "joy", "password": "joy321", "old_password": "admin"}}' &lt;A href="http://kjss1:8080/api/v1/users/joy" target="_blank"&gt;http://kjss1:8080/api/v1/users/joy&lt;/A&gt; &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;Please make sure to choose the "old_password" as the admin's users password which you used in the "-u admin:admin" command.  (please do not use "joy123"  as old password of that user).&lt;/P&gt;&lt;P&gt;Once you are able to change the password for user "joy" using above Ambari API. Then you should be able to invoke the same Rest API from your Java Code as well using  rest client APIs.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 20:46:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131034#M47620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-30T20:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically change Ambari admin password?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131035#M47621</link>
      <description>&lt;P&gt;Interesting, that differs slightly from the other documentation on the REST API I found here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/50102/managing-ambari-users-and-groups-using-rest-api.html" target="_blank"&gt;https://community.hortonworks.com/articles/50102/managing-ambari-users-and-groups-using-rest-api.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;At any rate, I appreciate the information and I will give that a try shortly.   Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 12:53:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131035#M47621</guid>
      <dc:creator>motley_crue_fan</dc:creator>
      <dc:date>2016-12-01T12:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically change Ambari admin password?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131036#M47622</link>
      <description>&lt;P&gt;@jss - thank you, that worked. Apparently the documentation I was looking at was incorrect or outdated&lt;/P&gt;&lt;P&gt;or something.  In either case, setting up the JSON the way you showed worked like a champ! &lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 14:00:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-programmatically-change-Ambari-admin-password/m-p/131036#M47622</guid>
      <dc:creator>motley_crue_fan</dc:creator>
      <dc:date>2016-12-01T14:00:11Z</dc:date>
    </item>
  </channel>
</rss>

