# Restoring .opendistro\_security as admin

**URL:** <https://forum.opensearch.org/t/restoring-opendistro-security-as-admin/1216>\
**Category:** Security\
**Created:** [July 26, 2019, 12:55pm UTC](https://forum.opensearch.org/t/restoring-opendistro-security-as-admin/1216 "2019-07-26T12:55:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![navatm](https://avatars.discourse-cdn.com/v4/letter/n/8e7dd6/32.png) [@navatm](https://forum.opensearch.org/u/navatm)\
**Post date:** [July 26, 2019, 12:55pm UTC](https://forum.opensearch.org/t/restoring-opendistro-security-as-admin/1216/1 "2019-07-26T12:55:09Z")

</div>

## What I’m trying to do

Restore the `.opendistro_security` index.

## What I’ve tried

Following the instructions on this page, I tried:

```
curl -k -u $ES_USER:$ES_PWD --cert admin.pem --key admin-key.pem \
    --header "Content-Type: application/json" \
    -XPOST https://localhost:9200/_snapshot/my_repo/my_snapshot/_restore \
    --data '{"include_global_state": false, "indices": "-.opendistro_security"}'

```

and got `security_exception`:

```
no permissions for [] and User [name=admin, roles=[admin], requestedTenant=null]

```

## I’ve also checked

Changed the last flag to:

`--data '{"include_global_state": false, "indices": "-.opendistro_security"}'`

Got no `security_exception` and it restored all other indices _but_ `.opendistro_security`.

## My question

How can I restore the `.opendistro_security` index?

---

<div class="post-metadata">

**Author:** ![ThibaudF](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/thibaudf/32/31_2.png) [@ThibaudF](https://forum.opensearch.org/u/ThibaudF)\
**Post date:** [July 30, 2019, 7:43am UTC](https://forum.opensearch.org/t/restoring-opendistro-security-as-admin/1216/2 "2019-07-30T07:43:09Z")

</div>

Hello @navatm !  
You can only restore .opendistro\_security index by using admin certificates + admin keys.

> `--data '{"include_global_state": false, "indices": "-.opendistro_security"}'`  
> Got no `security_exception` and it restored all other indices _but_`.opendistro_security` .

You should remove the " - " if you want to restore the .opendistro\_security, you excluded it right now.

```auto
`--data '{"include_global_state": false, "indices": "*"}'`

```

Hope I helped !  
Thi
