# Can't create esuser in shield

**URL:** https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132
**Category:** Elasticsearch
**Created:** [February 18, 2016, 11:15am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132 "2016-02-18T11:15:31Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 18, 2016, 11:15am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/1 "2016-02-18T11:15:31Z")

</div>

Hi ,

I'm trying to create after installing shield , the error I receive:  
Error: Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool  
My Elasticsearch is 1.7 , Kibana 4.0.2 , Shield version 1.3.2.  
I saw the problem in the forum

> [@Cannot create new user in shield](https://discuss.elastic.co/t/cannot-create-new-user-in-shield/33249):
>
> Hi Team, My cluster config is Elasticsearch (1.7.2) & Shield 2.0, Java 1.8 I am unable to create a new user for shield by using the following command bin/shield/esusers useradd espoweruser -r power\_user I am getting error as below. Error: Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool Please help me to resolve this error. Thanks, Ganeshbabu R

I changed my shield version to 1.3.2 and removed the other.

The command I'm using to create the user is:  
bin/shield/esusers useradd chenb -p chenb -r admin

I still receive the same error.  
Error: Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool

Can someone help me with this issue ?

BR,  
Chen

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [February 18, 2016, 11:28am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/2 "2016-02-18T11:28:13Z")

</div>

There is a script in the ES bin folder named [elasticsearch.in.sh](http://elasticsearch.in.sh). If you set this in the ES\_INCLUDE variable it works. I did this before I ran the esusers command:

export ES\_INCLUDE=`/elasticsearch/bin/elasticsearch.in.sh

Then I ran the command and it prompted for a password.

---

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 18, 2016, 11:46am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/3 "2016-02-18T11:46:28Z")

</div>

Hi ,

Now the error I receive when I'm trying to create the user is:  
You must set the ES\_CLASSPATH var

BR,  
Chen

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [February 18, 2016, 11:48am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/4 "2016-02-18T11:48:28Z")

</div>

You must set JAVA HOME in classpath as like below,

export ES\_CLASSPATH=/usr/java/jdk1.8.0\_60

---

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 18, 2016, 12:15pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/5 "2016-02-18T12:15:49Z")

</div>

Hi ,

Now I receive the first message:  
Error: Could not find or load main class org.elasticsearch.shield.authc.esusers.tool.ESUsersTool

BR,  
Chen

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [February 18, 2016, 1:03pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/6 "2016-02-18T13:03:54Z")

</div>

First set ES class path and then you need to set ES\_include

---

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 18, 2016, 1:06pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/7 "2016-02-18T13:06:21Z")

</div>

I still receive the same result.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3a64cbecb4f84c177b491baaa9c0faf238db3227.png)

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [February 18, 2016, 1:26pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/8 "2016-02-18T13:26:00Z")

</div>

I think ES\_INCLUDE is not setting properly and you should use "tilde" symbol before "/"

export ES\_INCLUDE=\*\*~/\*\*elasticsearch/bin/elasticsearch.in.sh

Try it like this...

---

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 18, 2016, 1:28pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/9 "2016-02-18T13:28:21Z")

</div>

Still the same result

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [February 18, 2016, 1:50pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/10 "2016-02-18T13:50:07Z")

</div>

This is how I did and It's worked for me.

May be ES members might help you.

---

<div class="post-metadata">

### Author: ![chenbe2204](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@chenbe2204](https://discuss.elastic.co/u/chenbe2204)
#### Post date: [February 21, 2016, 8:45am UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/11 "2016-02-21T08:45:28Z")

</div>

Thanks 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:14pm UTC](https://discuss.elastic.co/t/cant-create-esuser-in-shield/42132/12 "2017-07-05T23:14:40Z")

</div>


