# X-Pack truststore file generation

**URL:** <https://discuss.elastic.co/t/x-pack-truststore-file-generation/71093>\
**Category:** Elasticsearch\
**Created:** [January 10, 2017, 1:40pm UTC](https://discuss.elastic.co/t/x-pack-truststore-file-generation/71093 "2017-01-10T13:40:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 10, 2017, 1:40pm UTC](https://discuss.elastic.co/t/x-pack-truststore-file-generation/71093/1 "2017-01-10T13:40:35Z")

</div>

**When running the following command:**

`sudo keytool -genkey -alias elasticKeyStore -importcert -storepasswd -new <my new pass> -keystore /etc/elasticsearch/x-pack-truststore.jks -file /etc/elasticsearch/x-pack/kibanacrt/kibanacrt.crt`

**I am getting the exception:**

`keytool error: java.lang.Exception: Keystore file does not exist: /etc/elasticsearch/x-pack-truststore.jks`

What is my problem here?

Thanks  
Sharon.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [January 16, 2017, 11:05am UTC](https://discuss.elastic.co/t/x-pack-truststore-file-generation/71093/2 "2017-01-16T11:05:31Z")

</div>

Where did this command come from, and what exactly are you trying to achieve?  
You are mixing a bunch of commands into `keytool` that don't really belong together.

`-genkey`, `-importcert` and `-storepasswd` are all _"commands"_ that tell keytool which operation you want it to do. You wouldn't normally mix them into 1 command line.

In your case specifically, because `-storepasswd` is a command that _changes_ the password for an _existing_ keystore, it requires that the keystore exist.

---

<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:** [February 13, 2017, 11:05am UTC](https://discuss.elastic.co/t/x-pack-truststore-file-generation/71093/3 "2017-02-13T11:05:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
