ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yusaku Sako <yus...@hortonworks.com>
Subject Re: ambari user management
Date Fri, 12 Jun 2015 07:36:44 GMT
Ah, you are right, John.

Please try the following call:

curl -i -uadmin:admin -H "X-Requested-By: ambari" -X PUT -d '{"Users/password":"mysecret","Users/old_password":"admin"}}'
http://localhost:8080/api/v1/users/<user-name>


I hope this helps.

Yusaku

From: John Lane <john.lane169@googlemail.com<mailto:john.lane169@googlemail.com>>
Reply-To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Date: Tuesday, June 9, 2015 5:26 AM
To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Subject: ambari user management


Hi,

It seems that theprocedure described below in the user mailing list March 2014 no longer works
(with Ambari 1.7), is there a recommended alternative?

*******************

No, admins cannot change user passwords via configs.sh; configs.sh is a
wrapper that uses the API to manage "configuration" objects that do not
deal with user passwords.
However, admins can change passwords directly via the API (or with a
similar wrapper script).
Here's an example:

curl -i -uadmin:admin -H "X-Requested-By: ambari" -X PUT -d
'{"Users":{"roles":"admin,user","password":"mysecret","old_password":"admin"}}'
http://localhost:8080/api/v1/users/<user-name>

where:
* "roles" is a comma-delimited list of roles that the user should belong to
"admin,user" for admin users; just "user" for non-admin users.
* "password" is the new password to set for the user
* "old_password" is misleading, but* it's the password of the admin user
invoking this call*.  If you omit this parameter, the API call seems to go
thru, but the password does not actually change.  This is a bit redundant
and confusing, but that's how it works today...

I hope this helps!

Yusaku


****************

Regards

Mime
View raw message