setup-passwords.asciidoc 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [role="xpack"]
  2. [testenv="gold+"]
  3. [[setup-passwords]]
  4. == elasticsearch-setup-passwords
  5. The `elasticsearch-setup-passwords` command sets the passwords for the
  6. <<built-in-users,built-in users>>.
  7. [discrete]
  8. === Synopsis
  9. [source,shell]
  10. --------------------------------------------------
  11. bin/elasticsearch-setup-passwords auto|interactive
  12. [-b, --batch] [-h, --help] [-E <KeyValuePair>]
  13. [-s, --silent] [-u, --url "<URL>"] [-v, --verbose]
  14. --------------------------------------------------
  15. [discrete]
  16. === Description
  17. This command is intended for use only during the initial configuration of the
  18. {es} {security-features}. It uses the
  19. <<bootstrap-elastic-passwords,`elastic` bootstrap password>>
  20. to run user management API requests. If your {es} keystore is password protected,
  21. before you can set the passwords for the built-in users, you must enter the keystore password.
  22. After you set a password for the `elastic`
  23. user, the bootstrap password is no longer active and you cannot use this command.
  24. Instead, you can change passwords by using the *Management > Users* UI in {kib}
  25. or the <<security-api-change-password,Change Password API>>.
  26. This command uses an HTTP connection to connect to the cluster and run the user
  27. management requests. If your cluster uses TLS/SSL on the HTTP layer, the command
  28. automatically attempts to establish the connection by using the HTTPS protocol.
  29. It configures the connection by using the `xpack.security.http.ssl` settings in
  30. the `elasticsearch.yml` file. If you do not use the default config directory
  31. location, ensure that the *ES_PATH_CONF* environment variable returns the
  32. correct path before you run the `elasticsearch-setup-passwords` command. You can
  33. override settings in your `elasticsearch.yml` file by using the `-E` command
  34. option. For more information about debugging connection failures, see
  35. <<trb-security-setup>>.
  36. [discrete]
  37. [[setup-passwords-parameters]]
  38. === Parameters
  39. `auto`:: Outputs randomly-generated passwords to the console.
  40. `-b, --batch`:: If enabled, runs the change password process without prompting the
  41. user.
  42. `-E <KeyValuePair>`:: Configures a standard {es} or {xpack} setting.
  43. `-h, --help`:: Shows help information.
  44. `interactive`:: Prompts you to manually enter passwords.
  45. `-s, --silent`:: Shows minimal output.
  46. `-u, --url "<URL>"`:: Specifies the URL that the tool uses to submit the user management API
  47. requests. The default value is determined from the settings in your
  48. `elasticsearch.yml` file. If `xpack.security.http.ssl.enabled` is set to `true`,
  49. you must specify an HTTPS URL.
  50. `-v, --verbose`:: Shows verbose output.
  51. [discrete]
  52. === Examples
  53. The following example uses the `-u` parameter to tell the tool where to submit
  54. its user management API requests:
  55. [source,shell]
  56. --------------------------------------------------
  57. bin/elasticsearch-setup-passwords auto -u "http://localhost:9201"
  58. --------------------------------------------------