# Ssh keys behaviour question

**URL:** <https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620>\
**Category:** General\
**Created:** [11 August 2021 15:46 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620 "2021-08-11T15:46:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [11 August 2021 15:46 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/1 "2021-08-11T15:46:10Z")

</div>

When using projects with ssh keys, I'm a bit confused on how the ssh keys are loaded by Node-RED:  
If I start Node-RED normally and create a key, the key will be prepended by \_\_default.  
If I then start Node-RED using pm2, it doesn't see the keys anymore. If I re-create keys they show admin (which I assume is the user pm2 starts with ?).  
In order to see my original keys that were first created, renaming \_\_default to admin seems to work.  
I'm confused however on why I can't see the original keys when I start Node-RED using pm2...

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 August 2021 01:28 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/2 "2021-08-12T01:28:41Z")

</div>

I think you need to provide a bit more context. It isn't clear where/how you are trying to use the keys.

---

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [12 August 2021 02:00 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/3 "2021-08-12T02:00:15Z")

</div>

In the Node-RED editor in project mode.  
There’s a section where you can generate keys.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 August 2021 08:07 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/4 "2021-08-12T08:07:52Z")

</div>

Ah, projects. Now that makes more sense 🙂

I'm afraid though that I don't use the projects feature. Hopefully others will know more.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 August 2021 08:18 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/5 "2021-08-12T08:18:46Z")

</div>

Hi @nlecaude

When we create keys, we prefix the filename with the node-red user name. If adminAuth isn't enabled, we use `__default` as the 'user name' part of the filename. The system user the process is running under is irrelevant. We do that so in a multi-user system, we know which keys belong to which user.

The only way I can explain what you are seeing is if you don't have adminAuth setup when running 'normally', but you do when running under pm2 - and that `admin` is the username you have setup in `adminAuth`.

---

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [12 August 2021 12:14 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/6 "2021-08-12T12:14:16Z")

</div>

Ahhh that makes sense !  
Indeed the first time I start is without pm2 so that explains what I was seeing.  
Thanks Nick !

---

<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:** [26 August 2021 12:15 UTC](https://discourse.nodered.org/t/ssh-keys-behaviour-question/49620/7 "2021-08-26T12:15:05Z")

</div>

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