> For the complete documentation index, see [llms.txt](https://aqlu.gitbook.io/elasticsearch-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aqlu.gitbook.io/elasticsearch-reference/setup_elasticsearch/secure_settings.md).

# 安全配置

有一些设置是敏感的，通过文件系统的权限来保护是不足够的。基于这种场景，elasticsearch提供了一个keystore，可以通过密码保护。`elasticsearch-keystore`就是用来管理与设置keystore的工具。

> 注意
>
> 所有的指令都必须使用运行elasticsearch的用户来执行。

## 创建keystore

使用`create`指令来创建`elasticsearch.keystore`：

```bash
bin/elasticsearch-keystore create
```

`elasticsearch.keystore`文件将被创建在`elasticsearch.yml`文件的旁边。

## 列出keystore的配置

使用`list`指令来列出`elasticsearch.keystore`的设置：

```bash
bin/elasticsearch-keystore list
```

## 添加一个String设置

一些敏感的字符串，像云平台插件的一个认真参数，可以通过`add`指令来添加：

```bash
bin/elasticsearch-keystore add the.setting.name.to.set
```

工具将提示这个值得设置。如果要通过控制台展示，使用`--stdin`参数：

```bash
cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set
```

## 删除设置

使用`remove`指令来从`keystore`中删除配置：

```bash
bin/elasticsearch-keystore remove the.setting.name.to.remove
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aqlu.gitbook.io/elasticsearch-reference/setup_elasticsearch/secure_settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
