Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How do I remove LDAP accounts from Ambari

Solved Go to solution

How do I remove LDAP accounts from Ambari

I loaded LDAP accounts into Ambari and now need to remove them and re-sync. How do I remove the accounts?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How do I remove LDAP accounts from Ambari

Guru

Scott, you can use the API to remove them:

curl --insecure -u admin:$PASSWORD -H 'X-Requested-By: ambari' -X DELETE http://$AMBARI_HOST:8080/api/v1/users/paul

10 REPLIES 10

Re: How do I remove LDAP accounts from Ambari

@Scott Shaw

I believe you need to clean it up from ambari database.

for example:

[root@nsfed01 ~]# psql dbname username

Password for user ambari:

psql (8.4.20)

Type "help" for help.

ambari2112=> \dt

ambari2112=> select * from users where ldap_user=1;

user_id | principal_id | ldap_user | user_name | create_time | user_password | active | active_widget_layouts

---------+--------------+-----------+-----------+-------------+---------------+--------+-----------------------

(0 rows)

delete from users where ldap_user=1;

I aambari2112=> select * from users;

Re: How do I remove LDAP accounts from Ambari

@Paul Codding Is it ok to follow this approach?

Re: How do I remove LDAP accounts from Ambari

Guru

Scott, you can use the API to remove them:

curl --insecure -u admin:$PASSWORD -H 'X-Requested-By: ambari' -X DELETE http://$AMBARI_HOST:8080/api/v1/users/paul

Re: How do I remove LDAP accounts from Ambari

@Paul Codding This is helpful. Thanks! I believe , delete statement is not good idea to run..Comments?

Re: How do I remove LDAP accounts from Ambari

We went down the path of deleting directly from Oracle but ran into a bunch of relational constraints.

Re: How do I remove LDAP accounts from Ambari

Could you share delete statements for oracle?

@Scott Shaw

Re: How do I remove LDAP accounts from Ambari

We ended up going with Paul's solution and didn't try to delete from Oracle. Thanks for all your input and help!

Re: How do I remove LDAP accounts from Ambari

Guru

I've created an internal JIRA to support bulk deletion from the CLI

Re: How do I remove LDAP accounts from Ambari

@Paul Codding Do you have jira number? Is it internal?

Don't have an account?
Coming from Hortonworks? Activate your account here