# Can't remove key in keystone

**URL:** https://discuss.elastic.co/t/cant-remove-key-in-keystone/300943
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [March 29, 2022, 10:11am UTC](https://discuss.elastic.co/t/cant-remove-key-in-keystone/300943 "2022-03-29T10:11:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chaishiqi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chaishiqi/32/100441_2.png) [@chaishiqi](https://discuss.elastic.co/u/chaishiqi)
#### Post date: [March 29, 2022, 10:11am UTC](https://discuss.elastic.co/t/cant-remove-key-in-keystone/300943/1 "2022-03-29T10:11:26Z")

</div>

/usr/share/Elasticsearch/bin/Elasticsearch-keystore remove xpack.security.authc.realms.oidc.oidc1.rp.client\_secret

ERROR: will not overwrite keystore at [/etc/Elasticsearch/Elasticsearch.keystore], because this incurs changing the file owner

my es cluster version is 8.1.1, user is root,what's the problem?

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [March 29, 2022, 12:53pm UTC](https://discuss.elastic.co/t/cant-remove-key-in-keystone/300943/2 "2022-03-29T12:53:52Z")

</div>

It sounds like your keystore (`/etc/elasticsearch/elasticsearch.keystore`) is owned by an Elasticsearch specific user (probably `elasticsearch`) and you are running `/usr/share/elasticsearch/bin/elasticsearch-keystore` as the root user.

You need to run `/usr/share/elasticsearch/bin/elasticsearch-keystore` as the same user as owns the `/etc/elasticsearch/elasticsearch.keystore` file.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 26, 2022, 12:54pm UTC](https://discuss.elastic.co/t/cant-remove-key-in-keystone/300943/3 "2022-04-26T12:54:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
