Skip to content

[9.0] Update elasticsearch-keystore.md with special character handling and echo command to enter the password. (#127135) #127217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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]

Expand Down