# Installing mender-agent.pem

**URL:** <https://hub.mender.io/t/installing-mender-agent-pem/1123>\
**Category:** General Discussions\
**Created:** [October 8, 2019, 11:10am UTC](https://hub.mender.io/t/installing-mender-agent-pem/1123 "2019-10-08T11:10:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [October 8, 2019, 11:10am UTC](https://hub.mender.io/t/installing-mender-agent-pem/1123/1 "2019-10-08T11:10:41Z")

</div>

Hi,

I’m trying to support device pre-authorization and in documentation is written to deploy private key to /data/mender/mender-agent.pem. I’m using poky rocko but it seems it doesn’t work (verify final image and in /data/mender but file was not there). Checked bit mender classes and one seems to wipe out data and copy e.g. device\_identity and so on. any idea how to make it working or am I missing something obvious ? 🙂 Thanks.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 8, 2019, 11:14am UTC](https://hub.mender.io/t/installing-mender-agent-pem/1123/2 "2019-10-08T11:14:53Z")

</div>

With `/data/mender/` it is meant to store this on the persistent data partition and I think on `rocko` you would need to use the “old method” of installing files to the data partition.

Example is here:

> <https://github.com/mendersoftware/meta-mender/blob/rocko/meta-mender-demo/recipes-mender/hello-mender/hello-mender.bb>

You also need to add `MENDER_DATA_PART_DIR_append = "${DEPLOY_DIR_IMAGE}/persist"` somewhere.

On newer branches there is no “special handling” and installing to `/data` would convert it to the data partition.

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [October 8, 2019, 11:33am UTC](https://hub.mender.io/t/installing-mender-agent-pem/1123/3 "2019-10-08T11:33:43Z")

</div>

Thanks @mirzak I completely forgot about that (most of other stuff is running on newer mender yocto release) 👍
