@@ -11,9 +11,9 @@ in the {es} keystore.
1111[source,shell]
1212--------------------------------------------------
1313bin/elasticsearch-keystore
14- ([add <setting>] [--stdin] |
15- [add-file <setting> <path>] | [create] |
16- [list] | [remove <setting>] | [upgrade])
14+ ([add <setting>] [-f] [- -stdin] |
15+ [add-file <setting> <path>] | [create] [-p] |
16+ [list] | [passwd] | [ remove <setting>] | [upgrade])
1717[-h, --help] ([-s, --silent] | [-v, --verbose])
1818--------------------------------------------------
1919
@@ -26,6 +26,9 @@ IMPORTANT: This command should be run as the user that will run {es}.
2626Currently, all secure settings are node-specific settings that must have the
2727same value on every node. Therefore you must run this command on every node.
2828
29+ When the keystore is password-protected, you must supply the password each time
30+ {es} starts.
31+
2932Modifications to the keystore do not take effect until you restart {es}.
3033
3134Only some settings are designed to be read from the keystore. However, there
@@ -38,17 +41,36 @@ keystore, see the setting reference.
3841=== Parameters
3942
4043`add <setting>`:: Adds settings to the keystore. By default, you are prompted
41- for the value of the setting.
44+ for the value of the setting. If the keystore is password protected, you are
45+ also prompted to enter the password. If the setting already exists in the
46+ keystore, you must confirm that you want to overwrite the current value. If the
47+ keystore does not exist, you must confirm that you want to create a keystore. To
48+ avoid these two confirmation prompts, use the `-f` parameter.
4249
4350`add-file <setting> <path>`:: Adds a file to the keystore.
4451
4552`create`:: Creates the keystore.
4653
54+ `-f`:: When used with the `add` parameter, the command no longer prompts you
55+ before overwriting existing entries in the keystore. Also, if you haven't
56+ created a keystore yet, it creates a keystore that is obfuscated but not
57+ password protected.
58+
4759`-h, --help`:: Returns all of the command parameters.
4860
49- `list`:: Lists the settings in the keystore.
61+ `list`:: Lists the settings in the keystore. If the keystore is password
62+ protected, you are prompted to enter the password.
63+
64+ `-p`:: When used with the `create` parameter, the command prompts you to enter a
65+ keystore password. If you don't specify the `-p` flag or if you enter an empty
66+ password, the keystore is obfuscated but not password protected.
67+
68+ `passwd`:: Changes or sets the keystore password. If the keystore is password
69+ protected, you are prompted to enter the current password and the new one. You
70+ can optionally use an empty string to remove the password. If the keystore is
71+ not password protected, you can use this command to set a password.
5072
51- `remove <setting>:: Removes a setting from the keystore.
73+ `remove <setting>` :: Removes a setting from the keystore.
5274
5375`-s, --silent`:: Shows minimal output.
5476
@@ -71,11 +93,26 @@ To create the `elasticsearch.keystore`, use the `create` command:
7193
7294[source,sh]
7395----------------------------------------------------------------
74- bin/elasticsearch-keystore create
96+ bin/elasticsearch-keystore create -p
97+ ----------------------------------------------------------------
98+
99+ You are prompted to enter the keystore password. A password-protected
100+ `elasticsearch.keystore` file is created alongside the `elasticsearch.yml` file.
101+
102+ [discrete]
103+ [[changing-keystore-password]]
104+ ==== Change the password of the keystore
105+
106+ To change the password of the `elasticsearch.keystore`, use the `passwd` command:
107+
108+ [source,sh]
109+ ----------------------------------------------------------------
110+ bin/elasticsearch-keystore passwd
75111----------------------------------------------------------------
76112
77- A `elasticsearch.keystore` file is created alongside the `elasticsearch.yml`
78- file.
113+ If the {es} keystore is password protected, you are prompted to enter the
114+ current password and then enter the new one. If it is not password protected,
115+ you are prompted to set a password.
79116
80117[discrete]
81118[[list-settings]]
@@ -88,6 +125,9 @@ To list the settings in the keystore, use the `list` command.
88125bin/elasticsearch-keystore list
89126----------------------------------------------------------------
90127
128+ If the {es} keystore is password protected, you are prompted to enter the
129+ password.
130+
91131[discrete]
92132[[add-string-to-keystore]]
93133==== Add settings to the keystore
@@ -100,8 +140,10 @@ can be added with the `add` command:
100140bin/elasticsearch-keystore add the.setting.name.to.set
101141----------------------------------------------------------------
102142
103- You are prompted to enter the value of the setting. To pass the value
104- through standard input (stdin), use the `--stdin` flag:
143+ You are prompted to enter the value of the setting. If the {es} keystore is
144+ password protected, you are also prompted to enter the password.
145+
146+ To pass the setting value through standard input (stdin), use the `--stdin` flag:
105147
106148[source,sh]
107149----------------------------------------------------------------
@@ -121,6 +163,9 @@ after the setting name.
121163bin/elasticsearch-keystore add-file the.setting.name.to.set /path/example-file.json
122164----------------------------------------------------------------
123165
166+ If the {es} keystore is password protected, you are prompted to enter the
167+ password.
168+
124169[discrete]
125170[[remove-settings]]
126171==== Remove settings from the keystore
@@ -132,6 +177,9 @@ To remove a setting from the keystore, use the `remove` command:
132177bin/elasticsearch-keystore remove the.setting.name.to.remove
133178----------------------------------------------------------------
134179
180+ If the {es} keystore is password protected, you are prompted to enter the
181+ password.
182+
135183[discrete]
136184[[keystore-upgrade]]
137185==== Upgrade the keystore
0 commit comments