Elasticsearch-setup-passwords auto -url "http://localhost:9200" i want to run this command but getting error

while running this command in the elasticsearch bin folder cli

elasticsearch-setup-passwords auto -url "http://localhost:9200"

it is giving this error

Failed to authenticate user 'elastic' against http://localhost:9200/_security/_authenticate?pretty
Possible causes include:
 * The password for the 'elastic' user has already been changed on this cluster
 * Your elasticsearch node is running against a different keystore
   This tool used the keystore at C:\Elastic Stack\elasticsearch-8.12.0\config\elasticsearch.keystore

You can use the `elasticsearch-reset-password` CLI tool to reset the password of the 'elastic' user


ERROR: Failed to verify bootstrap password, with exit code 78

i tried changing the password of the elastic which is a built-in superuser
with this command

elasticsearch-reset-password -u elastic

password of user elastic is reseting successfully , then i use this command

elasticsearch-keystore add 'bootstrap.password'

to explicitly change the password in keystore but this is also giving error

ERROR: Setting name ['bootstrap.password'] does not match the allowed setting name pattern [[A-Za-z0-9_\-.]+], with exit code 65

i tried with the easiest password also but no luck its not getting updated

additional information:
while running this command

elasticsearch-users list

its giving

No users found

but i have a user named elastic with is super user i also tried that with the api calll

also i am getting this log in the elasticsearch CLI

[2024-02-09T16:13:27,590][INFO ][o.e.x.s.a.RealmsAuthenticator] [LAPTOP-58N3JBV9] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]

any help would be apperciated

@Karan37

What version elasticsearch?

How did you install?

What documentation did you follow?

Please share formatted elasticsearch.yml

What are you trying to accomplish?

Why are you trying to set the bootstrap password.. it is only initially used see here you don't need it after setup is done

After you ran reset password just try to curl with that user elastic and your new password.

i was just trying to understand and accomplish additional security

ohh, now i understand through the documentation i don't need to setup the passwords again

I'm impressed by the community's strength and support. I plan to contribute once I gain more expertise. Thanks sir for the great help