Support Questions

Find answers, ask questions, and share your expertise

How do I remove LDAP accounts from Ambari

avatar

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

1 ACCEPTED SOLUTION

avatar

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

View solution in original post

11 REPLIES 11

avatar
Master Mentor

@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;

avatar
Master Mentor

@Paul Codding Is it ok to follow this approach?

avatar

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

avatar
Master Mentor

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

avatar

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

avatar
Master Mentor

Could you share delete statements for oracle?

@Scott Shaw

avatar

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

avatar

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

avatar
Master Mentor

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