4

Context: Setting up Shield on my local machine for a 1 node Elasticsearch

Machine: Mac OSX 10.9.5

After installing Shield, I tried adding admin users but failed to do so because initially I did not restart my ES. During this attempt, I tried a bunch of username and password combinations(My bad here).

After I was pointed out that I had to restart ES before creating any users, I did so. Now, everytime I open localhost:9200 on my browser, I am required to provide a username and password.

I have tried most of the combinations that I 'attempted' to create earlier, but non seems to be the right one.

Upon running the bin/shield/users, it shows that I have one user which is my machine name. Tried again a bunch of possible passwords that I could think of, but nothing seems to be the right one. Below is the error I'm getting

{"error":"AuthenticationException[unable to authenticate user [username] for REST request [/_shield]]","status":401}

So, any idea on how I could reset the password or the delete the user entirely ??

Andrei Stefan
  • 51,654
  • 6
  • 98
  • 89
ChickenWing24
  • 205
  • 3
  • 12

1 Answers1

6

Use the esusers userdel username command to delete that username and add another one of your choice.

Andrei Stefan
  • 51,654
  • 6
  • 98
  • 89
  • Now all of a sudden, I'm getting back the "Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool error again." – ChickenWing24 Jul 03 '15 at 20:25
  • Do you have multiple ES installs on that node? Are you trying to start up the node differently? It sounds like you have one node somewhere and starting another node from a different location. – Andrei Stefan Jul 04 '15 at 03:55
  • I doubt so. Previously I installed ES via brew and started by running the command that allows ES to start as a service. After installing Shield, I shutdown ES and restarted it back using the same commands which can be found when I run `brew info elasticsearch`. So, I really don't think I am starting it either differently or from a different location. Sorry again for all this, I'm still getting a hang of it all. – ChickenWing24 Jul 04 '15 at 05:05
  • The story is like this with Shield: under `/plugins` lives Shield, in that folder there are some `*.jar` files. These are being used by Java, together with `*.jar` files from `/lib` folder. When Java doesn't find a class that exists in those jars, it's very likely it doesn't find the jar file. So, there must be something wrong with the installation, either with Shield itself or with ES. My suggestion, since you had several attempts at this: completely remove Elasticsearch and start from scratch: install ES, then Shield by the book. – Andrei Stefan Jul 04 '15 at 05:15
  • Thanks !! I'll do that. – ChickenWing24 Jul 04 '15 at 05:16
  • Reinstalling ES is doing the trick for now, have not installed Shield though. If you update your answer by including the reinstalling ES part, I would accept your answer. Might add a bit more context to others. – ChickenWing24 Jul 04 '15 at 07:27
  • Let's wait until you re-install Shield as well :-), that's the important bit. – Andrei Stefan Jul 04 '15 at 09:54
  • After trying all you've suggested, I think my problem is that I did not configure the environment correctly as said in the [Shield configuration](https://www.elastic.co/guide/en/shield/current/getting-started.html) long version. Should I open a new question for this or you can point me in the right direction. Again, so sorry for all this mess. – ChickenWing24 Jul 06 '15 at 04:08
  • Nope, even after restarting my ES, I can't run any of the esusers command. getting the `Error: Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool` – ChickenWing24 Jul 06 '15 at 05:16
  • Check to see if the user you are running `esusers` command with has access to files under `\plugins\shield` folder. – Andrei Stefan Jul 06 '15 at 07:29