# Docker : mount SSH Keys

**URL:** <https://discourse.nodered.org/t/docker-mount-ssh-keys/41259>\
**Category:** General\
**Created:** [18 February 2021 19:38 UTC](https://discourse.nodered.org/t/docker-mount-ssh-keys/41259 "2021-02-18T19:38:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashtez](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Ashtez](https://discourse.nodered.org/u/Ashtez)\
**Post date:** [18 February 2021 19:38 UTC](https://discourse.nodered.org/t/docker-mount-ssh-keys/41259/1 "2021-02-18T19:38:06Z")

</div>

Hello,

So here is the thing, from an exec node I run the command : `ssh user@192.x.x.x "sudo reboot"`  
Why ? Because my client sometimes has issues and NodeRed manages them and restarts the remote server to mitigate this. This works very well for me.

The problem is that every time I update my docker it looses my keys (logical). I thought about mounting them with : `--mount source=nodered-ssh,target=/usr/src/node-red/.ssh` but I have permissions problems. If I do that the .ssh folder belongs to root, and node-red cannot read my keys anymore.

Do you have any idea on how I could have persistent keys ?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 April 2021 19:38 UTC](https://discourse.nodered.org/t/docker-mount-ssh-keys/41259/2 "2021-04-19T19:38:39Z")

</div>

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