reset-password.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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] [--url] [-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. `--url`:: Specifies the base URL (hostname and port of the local node) that the tool uses to submit API
  44. requests to {es}. The default value is determined from the settings in your
  45. `elasticsearch.yml` file. If `xpack.security.http.ssl.enabled` is set to `true`,
  46. you must specify an HTTPS URL.
  47. `-v --verbose`:: Shows verbose output in the console.
  48. [discrete]
  49. === Examples
  50. The following example resets the password of the `elastic` user to an auto-generated value and
  51. prints the new password in the console:
  52. [source,shell]
  53. ----
  54. bin/elasticsearch-reset-password -u elastic
  55. ----
  56. The following example resets the password of a native user with username `user1` after prompting
  57. in the terminal for the desired password:
  58. [source,shell]
  59. ----
  60. bin/elasticsearch-reset-password --username user1 -i
  61. ----
  62. The following example resets the password of a native user with username `user2` to an auto-generated value
  63. prints the new password in the console. The specified URL indicates where the elasticsearch-reset-password
  64. tool attempts to reach the local {es} node:
  65. [source,shell]
  66. ----
  67. bin/elasticsearch-reset-password --url "https://172.0.0.3:9200" --username user2 -i
  68. ----