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 ??

2
  • And if you add another user with esusers and try that? Commented Jul 3, 2015 at 13:10
  • Also, you know that you can simply remove that user, right? Using esusers userdel username. Commented Jul 3, 2015 at 13:13

1 Answer 1

6

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

10
  • 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." Commented Jul 3, 2015 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. Commented Jul 4, 2015 at 3: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. Commented Jul 4, 2015 at 5: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. Commented Jul 4, 2015 at 5:15
  • Thanks !! I'll do that. Commented Jul 4, 2015 at 5:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.