Rename setup-passwords

This commit renames setup-passwords to elasticsearch-setup-passwords.
This commit is contained in:
Jason Tedor 2018-04-11 11:21:15 -04:00 committed by Ryan Ernst
parent 03ffd16921
commit 7ba2defdbf
13 changed files with 62 additions and 57 deletions

View File

@ -1,16 +1,16 @@
[role="xpack"] [role="xpack"]
[[setup-passwords]] [[setup-passwords]]
== setup-passwords == elasticsearch-setup-passwords
The `setup-passwords` command sets the passwords for the built-in `elastic`, The `elasticsearch-setup-passwords` command sets the passwords for the built-in
`kibana`, `logstash_system`, and `beats_system` users. `elastic`, `kibana`, `logstash_system`, and `beats_system` users.
[float] [float]
=== Synopsis === Synopsis
[source,shell] [source,shell]
-------------------------------------------------- --------------------------------------------------
bin/x-pack/setup-passwords auto|interactive bin/elasticsearch-setup-passwords auto|interactive
[-b, --batch] [-h, --help] [-E <KeyValuePair>] [-b, --batch] [-h, --help] [-E <KeyValuePair>]
[-s, --silent] [-u, --url "<URL>"] [-v, --verbose] [-s, --silent] [-u, --url "<URL>"] [-v, --verbose]
-------------------------------------------------- --------------------------------------------------
@ -32,10 +32,10 @@ automatically attempts to establish the connection by using the HTTPS protocol.
It configures the connection by using the `xpack.security.http.ssl` settings in It configures the connection by using the `xpack.security.http.ssl` settings in
the `elasticsearch.yml` file. If you do not use the default config directory the `elasticsearch.yml` file. If you do not use the default config directory
location, ensure that the *ES_PATH_CONF* environment variable returns the location, ensure that the *ES_PATH_CONF* environment variable returns the
correct path before you run the `setup-passwords` command. You can override correct path before you run the `elasticsearch-setup-passwords` command. You can
settings in your `elasticsearch.yml` file by using the `-E` command option. override settings in your `elasticsearch.yml` file by using the `-E` command
For more information about debugging connection failures, see option. For more information about debugging connection failures, see
{xpack-ref}/trb-security-setup.html[Setup-passwords command fails due to connection failure]. {xpack-ref}/trb-security-setup.html[`elasticsearch-setup-passwords` command fails due to connection failure].
[float] [float]
=== Parameters === Parameters
@ -68,5 +68,5 @@ its user management API requests:
[source,shell] [source,shell]
-------------------------------------------------- --------------------------------------------------
bin/x-pack/setup-passwords auto -u "http://localhost:9201" bin/elasticsearch-setup-passwords auto -u "http://localhost:9201"
-------------------------------------------------- --------------------------------------------------

View File

@ -66,23 +66,23 @@ password.
You must set the passwords for all built-in users. You must set the passwords for all built-in users.
The +setup-passwords+ tool is the simplest method to set the built-in users' The +elasticsearch-setup-passwords+ tool is the simplest method to set the
passwords for the first time. It uses the `elastic` user's bootstrap password to built-in users' passwords for the first time. It uses the `elastic` user's
run user management API requests. For example, you can run the command in bootstrap password to run user management API requests. For example, you can run
an "interactive" mode, which prompts you to enter new passwords for the the command in an "interactive" mode, which prompts you to enter new passwords
`elastic`, `kibana`, `logstash_system`, and `beats_system` users: for the `elastic`, `kibana`, `logstash_system`, and `beats_system` users:
[source,shell] [source,shell]
-------------------------------------------------- --------------------------------------------------
bin/x-pack/setup-passwords interactive bin/elasticsearch-setup-passwords interactive
-------------------------------------------------- --------------------------------------------------
For more information about the command options, see For more information about the command options, see
{ref}/setup-passwords.html[setup-passwords]. {ref}/setup-passwords.html[elasticsearch-setup-passwords].
IMPORTANT: After you set a password for the `elastic` user, the bootstrap IMPORTANT: After you set a password for the `elastic` user, the bootstrap
password is no longer valid; you cannot run the `setup-passwords` command a password is no longer valid; you cannot run the `elasticsearch-setup-passwords`
second time. command a second time.
Alternatively, you can set the initial passwords for the built-in users by using Alternatively, you can set the initial passwords for the built-in users by using
the *Management > Users* page in {kib} or the the *Management > Users* page in {kib} or the

View File

@ -48,8 +48,8 @@ information, see
-- --
{security} provides {security} provides
{xpack-ref}/setting-up-authentication.html#built-in-users[built-in users] to {xpack-ref}/setting-up-authentication.html#built-in-users[built-in users] to
help you get up and running. The +setup-passwords+ command is the simplest help you get up and running. The +elasticsearch-setup-passwords+ command is the
method to set the built-in users' passwords for the first time. simplest method to set the built-in users' passwords for the first time.
For example, you can run the command in an "interactive" mode, which prompts you For example, you can run the command in an "interactive" mode, which prompts you
to enter new passwords for the `elastic`, `kibana`, `beats_system`, and to enter new passwords for the `elastic`, `kibana`, `beats_system`, and
@ -57,15 +57,16 @@ to enter new passwords for the `elastic`, `kibana`, `beats_system`, and
[source,shell] [source,shell]
-------------------------------------------------- --------------------------------------------------
bin/x-pack/setup-passwords interactive bin/elasticsearch-setup-passwords interactive
-------------------------------------------------- --------------------------------------------------
For more information about the command options, see <<setup-passwords>>. For more information about the command options, see <<setup-passwords>>.
IMPORTANT: The `setup-passwords` command uses a transient bootstrap password IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient bootstrap
that is no longer valid after the command runs successfully. You cannot run the password that is no longer valid after the command runs successfully. You cannot
`setup-passwords` command a second time. Instead, you can update passwords from run the `elasticsearch-setup-passwords` command a second time. Instead, you can
the **Management > Users** UI in {kib} or use the security user API. update passwords from the **Management > Users** UI in {kib} or use the security
user API.
-- --

View File

@ -174,14 +174,14 @@ curl --cacert certs/ca/ca.crt -u elastic:PleaseChangeMe https://localhost:9200
---- ----
// NOTCONSOLE // NOTCONSOLE
-- --
. The `setup-passwords` tool can also be used to generate random passwords for . The `elasticsearch-setup-passwords` tool can also be used to generate random
all users: passwords for all users:
+ +
-- --
WARNING: Windows users not running PowerShell will need to remove `\` and join lines in the snippet below. WARNING: Windows users not running PowerShell will need to remove `\` and join lines in the snippet below.
["source","sh"] ["source","sh"]
---- ----
docker exec es01 /bin/bash -c "bin/x-pack/setup-passwords \ docker exec es01 /bin/bash -c "bin/elasticsearch-setup-passwords \
auto --batch \ auto --batch \
-Expack.ssl.certificate=x-pack/certificates/es01/es01.crt \ -Expack.ssl.certificate=x-pack/certificates/es01/es01.crt \
-Expack.ssl.certificate_authorities=x-pack/certificates/ca/ca.crt \ -Expack.ssl.certificate_authorities=x-pack/certificates/ca/ca.crt \

View File

@ -336,11 +336,11 @@ Otherwise, {kib} cannot connect to {es}.
[[trb-security-setup]] [[trb-security-setup]]
=== Setup-passwords command fails due to connection failure === Setup-passwords command fails due to connection failure
The {ref}/setup-passwords.html[setup-passwords command] sets passwords for The {ref}/setup-passwords.html[elasticsearch-setup-passwords command] sets
the built-in users by sending user management API requests. If your cluster uses passwords for the built-in users by sending user management API requests. If
SSL/TLS for the HTTP (REST) interface, the command attempts to establish a your cluster uses SSL/TLS for the HTTP (REST) interface, the command attempts to
connection with the HTTPS protocol. If the connection attempt fails, the establish a connection with the HTTPS protocol. If the connection attempt fails,
command fails. the command fails.
*Symptoms:* *Symptoms:*
@ -400,10 +400,10 @@ https://elasticsearch.example.com:9200/_xpack/security/_authenticate?pretty.
*Resolution:* *Resolution:*
. If your cluster uses TLS/SSL for the HTTP interface but the `setup-passwords` . If your cluster uses TLS/SSL for the HTTP interface but the
command attempts to establish a non-secure connection, use the `--url` command `elasticsearch-setup-passwords` command attempts to establish a non-secure
option to explicitly specify an HTTPS URL. Alternatively, set the connection, use the `--url` command option to explicitly specify an HTTPS URL.
`xpack.security.http.ssl.enabled` setting to `true`. Alternatively, set the `xpack.security.http.ssl.enabled` setting to `true`.
. If the command does not trust the {es} server, verify that you configured the . If the command does not trust the {es} server, verify that you configured the
`xpack.security.http.ssl.certificate_authorities` setting or the `xpack.security.http.ssl.certificate_authorities` setting or the

View File

@ -3,23 +3,24 @@
+ +
-- --
If you have enabled {security}, it provides built-in user credentials to help you If you have enabled {security}, it provides built-in user credentials to help you
get up and running. The +setup-passwords+ command is the simplest method to set get up and running. The +elasticsearch-setup-passwords+ command is the simplest
the built-in users' passwords for the first time. method to set the built-in users' passwords for the first time.
For example, you can run the command in an "interactive" mode, which prompts you For example, you can run the command in an "interactive" mode, which prompts you
to enter new passwords for the `elastic`, `kibana`, and `logstash_system` users: to enter new passwords for the `elastic`, `kibana`, and `logstash_system` users:
[source,shell] [source,shell]
-------------------------------------------------- --------------------------------------------------
bin/x-pack/setup-passwords interactive bin/elasticsearch-setup-passwords interactive
-------------------------------------------------- --------------------------------------------------
For more information about the command options, see <<setup-passwords>>. For more information about the command options, see <<setup-passwords>>.
IMPORTANT: The `setup-passwords` command uses a transient bootstrap password IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient
that is no longer valid after the command runs successfully. You cannot run the bootstrap password that is no longer valid after the command runs successfully.
`setup-passwords` command a second time. Instead, you can update passwords from You cannot run the `elasticsearch-setup-passwords` command a second time.
the **Management > Users** UI in {kib} or use the security user API. Instead, you can update passwords from the **Management > Users** UI in {kib} or
use the security user API.
For more information, see For more information, see
{xpack-ref}/setting-up-authentication.html#set-built-in-user-passwords[Setting Built-in User Passwords]. {xpack-ref}/setting-up-authentication.html#set-built-in-user-passwords[Setting Built-in User Passwords].

View File

@ -428,7 +428,8 @@ public class SetupPasswordTool extends LoggingAwareMultiCommand {
} }
} }
terminal.println(""); terminal.println("");
terminal.println("It is recommended that you resolve the issues with your cluster before running setup-passwords."); terminal.println(
"It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords.");
terminal.println("It is very likely that the password changes will fail when run against an unhealthy cluster."); terminal.println("It is very likely that the password changes will fail when run against an unhealthy cluster.");
terminal.println(""); terminal.println("");
if (shouldPrompt) { if (shouldPrompt) {

View File

@ -93,11 +93,11 @@ NODE_SETTINGS
fi fi
run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_OK" run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_OK"
echo 'y' | $ESHOME/bin/setup-passwords auto echo 'y' | $ESHOME/bin/elasticsearch-setup-passwords auto
SETUP_OK SETUP_OK
echo "$output" > /tmp/setup-passwords-output-with-bootstrap echo "$output" > /tmp/setup-passwords-output-with-bootstrap
[ "$status" -eq 0 ] || { [ "$status" -eq 0 ] || {
echo "Expected x-pack setup-passwords tool exit code to be zero but got [$status]" echo "Expected x-pack elasticsearch-setup-passwords tool exit code to be zero but got [$status]"
cat /tmp/setup-passwords-output-with-bootstrap cat /tmp/setup-passwords-output-with-bootstrap
debug_collect_logs debug_collect_logs
false false
@ -111,7 +111,7 @@ SETUP_OK
users=( elastic kibana logstash_system ) users=( elastic kibana logstash_system )
for user in "${users[@]}"; do for user in "${users[@]}"; do
grep "Changed password for user $user" /tmp/setup-passwords-output-with-bootstrap || { grep "Changed password for user $user" /tmp/setup-passwords-output-with-bootstrap || {
echo "Expected x-pack setup-passwords tool to change password for user [$user]:" echo "Expected x-pack elasticsearch-setup-passwords tool to change password for user [$user]:"
cat /tmp/setup-passwords-output-with-bootstrap cat /tmp/setup-passwords-output-with-bootstrap
false false
} }

View File

@ -155,10 +155,11 @@ start_node_using_package() {
export ESHOME="$MASTER_HOME" export ESHOME="$MASTER_HOME"
export_elasticsearch_paths export_elasticsearch_paths
# For the sake of simplicity we use a bootstrap password in this test. # For the sake of simplicity we use a bootstrap password in this test. The
# The alternative would be to start the master node, use setup-passwords # alternative would be to start the master node, use
# and restart the node once ssl/tls is configured. Or use setup-passwords over # elasticsearch-setup-passwords and restart the node once ssl/tls is
# HTTPS with the right cacerts imported into a Java keystore. # configured. Or use elasticsearch-setup-passwords over HTTPS with the right
# cacerts imported into a Java keystore.
run sudo -E -u $MASTER_USER bash <<"NEW_PASS" run sudo -E -u $MASTER_USER bash <<"NEW_PASS"
if [[ ! -f $ESCONFIG/elasticsearch.keystore ]]; then if [[ ! -f $ESCONFIG/elasticsearch.keystore ]]; then
$ESHOME/bin/elasticsearch-keystore create $ESHOME/bin/elasticsearch-keystore create

View File

@ -1,3 +1,4 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@ -50,11 +51,11 @@ fi
wait_for_xpack wait_for_xpack
run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_AUTO" run sudo -E -u $ESPLUGIN_COMMAND_USER bash <<"SETUP_AUTO"
echo 'y' | $ESHOME/bin/setup-passwords auto echo 'y' | $ESHOME/bin/elasticsearch-setup-passwords auto
SETUP_AUTO SETUP_AUTO
echo "$output" > /tmp/setup-passwords-output echo "$output" > /tmp/setup-passwords-output
[ "$status" -eq 0 ] || { [ "$status" -eq 0 ] || {
echo "Expected x-pack setup-passwords tool exit code to be zero" echo "Expected x-pack elasticsearch-setup-passwords tool exit code to be zero"
cat /tmp/setup-passwords-output cat /tmp/setup-passwords-output
false false
} }
@ -67,7 +68,7 @@ SETUP_AUTO
users=( elastic kibana logstash_system ) users=( elastic kibana logstash_system )
for user in "${users[@]}"; do for user in "${users[@]}"; do
grep "Changed password for user $user" /tmp/setup-passwords-output || { grep "Changed password for user $user" /tmp/setup-passwords-output || {
echo "Expected x-pack setup-passwords tool to change password for user [$user]:" echo "Expected x-pack elasticsearch-setup-passwords tool to change password for user [$user]:"
cat /tmp/setup-passwords-output cat /tmp/setup-passwords-output
false false
} }

View File

@ -24,8 +24,8 @@ verify_xpack_installation() {
'migrate.bat' 'migrate.bat'
'saml-metadata' 'saml-metadata'
'saml-metadata.bat' 'saml-metadata.bat'
'setup-passwords' 'elasticsearch-setup-passwords'
'setup-passwords.bat' 'elasticsearch-setup-passwords.bat'
'sql-cli' 'sql-cli'
'sql-cli.bat' 'sql-cli.bat'
"sql-cli-$(cat version).jar" # This jar is executable so we pitch it in bin so folks will find it "sql-cli-$(cat version).jar" # This jar is executable so we pitch it in bin so folks will find it