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"]
[[setup-passwords]]
== setup-passwords
== elasticsearch-setup-passwords
The `setup-passwords` command sets the passwords for the built-in `elastic`,
`kibana`, `logstash_system`, and `beats_system` users.
The `elasticsearch-setup-passwords` command sets the passwords for the built-in
`elastic`, `kibana`, `logstash_system`, and `beats_system` users.
[float]
=== Synopsis
[source,shell]
--------------------------------------------------
bin/x-pack/setup-passwords auto|interactive
bin/elasticsearch-setup-passwords auto|interactive
[-b, --batch] [-h, --help] [-E <KeyValuePair>]
[-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
the `elasticsearch.yml` file. If you do not use the default config directory
location, ensure that the *ES_PATH_CONF* environment variable returns the
correct path before you run the `setup-passwords` command. You can override
settings in your `elasticsearch.yml` file by using the `-E` command option.
For more information about debugging connection failures, see
{xpack-ref}/trb-security-setup.html[Setup-passwords command fails due to connection failure].
correct path before you run the `elasticsearch-setup-passwords` command. You can
override settings in your `elasticsearch.yml` file by using the `-E` command
option. For more information about debugging connection failures, see
{xpack-ref}/trb-security-setup.html[`elasticsearch-setup-passwords` command fails due to connection failure].
[float]
=== Parameters
@ -68,5 +68,5 @@ its user management API requests:
[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.
The +setup-passwords+ tool is the simplest method to set the built-in users'
passwords for the first time. It uses the `elastic` user's bootstrap password to
run user management API requests. For example, you can run the command in
an "interactive" mode, which prompts you to enter new passwords for the
`elastic`, `kibana`, `logstash_system`, and `beats_system` users:
The +elasticsearch-setup-passwords+ tool is the simplest method to set the
built-in users' passwords for the first time. It uses the `elastic` user's
bootstrap password to run user management API requests. For example, you can run
the command in an "interactive" mode, which prompts you to enter new passwords
for the `elastic`, `kibana`, `logstash_system`, and `beats_system` users:
[source,shell]
--------------------------------------------------
bin/x-pack/setup-passwords interactive
bin/elasticsearch-setup-passwords interactive
--------------------------------------------------
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
password is no longer valid; you cannot run the `setup-passwords` command a
second time.
password is no longer valid; you cannot run the `elasticsearch-setup-passwords`
command a second time.
Alternatively, you can set the initial passwords for the built-in users by using
the *Management > Users* page in {kib} or the

View File

@ -48,8 +48,8 @@ information, see
--
{security} provides
{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
method to set the built-in users' passwords for the first time.
help you get up and running. The +elasticsearch-setup-passwords+ command is the
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
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]
--------------------------------------------------
bin/x-pack/setup-passwords interactive
bin/elasticsearch-setup-passwords interactive
--------------------------------------------------
For more information about the command options, see <<setup-passwords>>.
IMPORTANT: The `setup-passwords` command uses a transient bootstrap password
that is no longer valid after the command runs successfully. You cannot run the
`setup-passwords` command a second time. Instead, you can update passwords from
the **Management > Users** UI in {kib} or use the security user API.
IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient bootstrap
password that is no longer valid after the command runs successfully. You cannot
run the `elasticsearch-setup-passwords` command a second time. Instead, you can
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
--
. The `setup-passwords` tool can also be used to generate random passwords for
all users:
. The `elasticsearch-setup-passwords` tool can also be used to generate random
passwords for all users:
+
--
WARNING: Windows users not running PowerShell will need to remove `\` and join lines in the snippet below.
["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 \
-Expack.ssl.certificate=x-pack/certificates/es01/es01.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]]
=== Setup-passwords command fails due to connection failure
The {ref}/setup-passwords.html[setup-passwords command] sets passwords for
the built-in users by sending user management API requests. If your cluster uses
SSL/TLS for the HTTP (REST) interface, the command attempts to establish a
connection with the HTTPS protocol. If the connection attempt fails, the
command fails.
The {ref}/setup-passwords.html[elasticsearch-setup-passwords command] sets
passwords for the built-in users by sending user management API requests. If
your cluster uses SSL/TLS for the HTTP (REST) interface, the command attempts to
establish a connection with the HTTPS protocol. If the connection attempt fails,
the command fails.
*Symptoms:*
@ -400,10 +400,10 @@ https://elasticsearch.example.com:9200/_xpack/security/_authenticate?pretty.
*Resolution:*
. If your cluster uses TLS/SSL for the HTTP interface but the `setup-passwords`
command attempts to establish a non-secure connection, use the `--url` command
option to explicitly specify an HTTPS URL. Alternatively, set the
`xpack.security.http.ssl.enabled` setting to `true`.
. If your cluster uses TLS/SSL for the HTTP interface but the
`elasticsearch-setup-passwords` command attempts to establish a non-secure
connection, use the `--url` command option to explicitly specify an HTTPS URL.
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
`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
get up and running. The +setup-passwords+ command is the simplest method to set
the built-in users' passwords for the first time.
get up and running. The +elasticsearch-setup-passwords+ command is the 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
to enter new passwords for the `elastic`, `kibana`, and `logstash_system` users:
[source,shell]
--------------------------------------------------
bin/x-pack/setup-passwords interactive
bin/elasticsearch-setup-passwords interactive
--------------------------------------------------
For more information about the command options, see <<setup-passwords>>.
IMPORTANT: The `setup-passwords` command uses a transient bootstrap password
that is no longer valid after the command runs successfully. You cannot run the
`setup-passwords` command a second time. Instead, you can update passwords from
the **Management > Users** UI in {kib} or use the security user API.
IMPORTANT: The `elasticsearch-setup-passwords` command uses a transient
bootstrap password that is no longer valid after the command runs successfully.
You cannot run the `elasticsearch-setup-passwords` command a second time.
Instead, you can update passwords from the **Management > Users** UI in {kib} or
use the security user API.
For more information, see
{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("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("");
if (shouldPrompt) {

View File

@ -93,11 +93,11 @@ NODE_SETTINGS
fi
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
echo "$output" > /tmp/setup-passwords-output-with-bootstrap
[ "$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
debug_collect_logs
false
@ -111,7 +111,7 @@ SETUP_OK
users=( elastic kibana logstash_system )
for user in "${users[@]}"; do
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
false
}

View File

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

View File

@ -1,3 +1,4 @@
#!/usr/bin/env bats
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@ -50,11 +51,11 @@ fi
wait_for_xpack
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
echo "$output" > /tmp/setup-passwords-output
[ "$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
false
}
@ -67,7 +68,7 @@ SETUP_AUTO
users=( elastic kibana logstash_system )
for user in "${users[@]}"; do
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
false
}

View File

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