reset-password.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. [roles="xpack"]
  2. [[reset-password]]
  3. == elasticsearch-reset-password
  4. The `elasticsearch-reset-password` command resets the passwords of users in
  5. the native realm and built-in users.
  6. [discrete]
  7. === Synopsis
  8. [source,shell]
  9. ----
  10. bin/elasticsearch-reset-password
  11. [-a, --auto] [-b, --batch] [-E <KeyValuePair]
  12. [-f, --force] [-h, --help] [-i, --interactive]
  13. [-s, --silent] [-u, --username] [-v, --verbose]
  14. ----
  15. [discrete]
  16. === Description
  17. Use this command to reset the password of any user in the native realm
  18. or any built-in user. By default, a strong password is generated for you.
  19. To explicitly set a password, run the tool in interactive mode with `-i`.
  20. The command generates (and subsequently removes) a temporary user in the
  21. <<file-realm,file realm>> to run the request that changes the user password.
  22. IMPORTANT: You cannot use this tool if the file realm is disabled in your `elasticsearch.yml` file.
  23. This command uses an HTTP connection to connect to the cluster and run the user
  24. management requests. The command automatically attempts to establish the connection
  25. over HTTPS by using the `xpack.security.http.ssl` settings in
  26. the `elasticsearch.yml` file. If you do not use the default configuration directory
  27. location, ensure that the `ES_PATH_CONF` environment variable returns the
  28. correct path before you run the `elasticsearch-reset-password` command. You can
  29. override settings in your `elasticsearch.yml` file by using the `-E` command
  30. option. For more information about debugging connection failures, see
  31. <<trb-security-setup>>.
  32. [discrete]
  33. [[reset-password-parameters]]
  34. === Parameters
  35. `-a, --auto`:: Resets the password of the specified user to an auto-generated strong password. (Default)
  36. `-b, --batch`:: Runs the reset password process without prompting the user for verification.
  37. `-E <KeyValuePair>`:: Configures a standard {es} or {xpack} setting.
  38. `-f, --force`:: Forces the command to run against an unhealthy cluster.
  39. `-h, --help`:: Returns all of the command parameters.
  40. `-i, --interactive`:: Prompts for the password of the specified user. Use this option to explicitly set a password.
  41. `-s --silent`:: Shows minimal output in the console.
  42. `-u, --username`:: The username of the native realm user or built-in user.
  43. `-v --verbose`:: Shows verbose output in the console.
  44. [discrete]
  45. === Examples
  46. The following example resets the password of the `elastic` user to an auto-generated value and
  47. prints the new password in the console.
  48. [source,shell]
  49. ----
  50. bin/elasticsearch-reset-password -u elastic
  51. ----
  52. The following example resets the password of a native user with username `user1` after prompting
  53. in the terminal for the desired password:
  54. [source,shell]
  55. ----
  56. bin/elasticsearch-reset-password --username user1 -i
  57. ----