diff --git a/docs/reference/elasticsearch/command-line-tools/elasticsearch-keystore.md b/docs/reference/elasticsearch/command-line-tools/elasticsearch-keystore.md index 353c66d7a9b91..1860607a6201d 100644 --- a/docs/reference/elasticsearch/command-line-tools/elasticsearch-keystore.md +++ b/docs/reference/elasticsearch/command-line-tools/elasticsearch-keystore.md @@ -88,6 +88,20 @@ Only some settings are designed to be read from the keystore. However, there is `-v, --verbose` : Shows verbose output. +## Handling special characters + +:::{important} +Improper handling of special characters can lead to authentication failures and service outages. +::: + +**Exclamation mark**: `!` +: When using the shell, the combination `\!` is stored as just `!`. This can lead to authentication failures if the password is not stored as intended. + +**Quotes**: `"` +: If quotes are used around the password, they become part of the password itself. This can cause the password to be incorrect when retrieved from the keystore. + +**Backslash**: `\` +: The backslash character needs to be properly escaped. If not escaped correctly, it may be omitted or misinterpreted, leading to incorrect password storage. ## Examples [elasticsearch-keystore-examples] @@ -150,9 +164,13 @@ To pass the settings values through standard input (stdin), use the `--stdin` fl ```sh cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set ``` +Alternatively, you can use the echo command to input the password into the keystore. For example, if the password is `your\!password` : -Values for multiple settings must be separated by carriage returns or newlines. +```sh +echo -n 'your\!password' | bin/elasticsearch-keystore add the.setting.name.to.set +``` +Values for multiple settings must be separated by carriage returns or newlines. ### Add files to the keystore [add-file-to-keystore]