# Reuse SSH keys when connecting to Bitbucket

**URL:** <https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360>\
**Category:** General\
**Created:** [21 October 2022 08:58 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360 "2022-10-21T08:58:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gylim78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gylim78/32/69495_2.png) [@gylim78](https://discourse.nodered.org/u/gylim78)\
**Post date:** [21 October 2022 08:58 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/1 "2022-10-21T08:58:11Z")

</div>

Hi all,

I have created a project in NR and linked it to my repo on bitbucket.  
To connect to bitbucket, I created an SSH key in NR and then added the key into Bitbucket.

My project is deployed in a docker container on a Rpi 4.

I am wondering if there is a way to reuse the created SSH key?  
Because it seems like for every new deployment of a Rpi 4 of the same project I will need to keep creating a new SSH key and then add that new key into Bitbucket. In no time, my Bitbucket will be full of SSH keys.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2022 09:16 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/2 "2022-10-21T09:16:57Z")

</div>

Welcome to the forum @gylim78

Do you mean that you will have many PIs and want to use the same key for all of them?

---

<div class="post-metadata">

**Author:** ![gylim78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gylim78/32/69495_2.png) [@gylim78](https://discourse.nodered.org/u/gylim78)\
**Post date:** [21 October 2022 09:22 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/3 "2022-10-21T09:22:22Z")

</div>

Hi Colin,

Yes. That is correct.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2022 09:38 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/4 "2022-10-21T09:38:09Z")

</div>

Do you need the key in order to be able to read from the repository, or is it public?  
Or do they all need to be able to write to the repo?

---

<div class="post-metadata">

**Author:** ![gylim78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gylim78/32/69495_2.png) [@gylim78](https://discourse.nodered.org/u/gylim78)\
**Post date:** [21 October 2022 09:50 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/5 "2022-10-21T09:50:37Z")

</div>

Private Repo.  
Most likely, we will need to write to the repo.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2022 09:56 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/6 "2022-10-21T09:56:49Z")

</div>

Whilst I am sure it is possible to replicate the key, it would certainly be frowned on from the security point of view. Have you consider what would happen if one of these (presumably hundreds) of PIs was compromised in some way? In order to protect the repo you would have to revoke the key and then you would need to create new keys in all the other PIs

---

<div class="post-metadata">

**Author:** ![gylim78](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gylim78/32/69495_2.png) [@gylim78](https://discourse.nodered.org/u/gylim78)\
**Post date:** [25 October 2022 09:47 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/7 "2022-10-25T09:47:31Z")

</div>

Hey Colin,

Thanks for your advise.  
I guess I will create a new SSH key for each device then.

---

<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:** [24 December 2022 09:47 UTC](https://discourse.nodered.org/t/reuse-ssh-keys-when-connecting-to-bitbucket/69360/8 "2022-12-24T09:47:35Z")

</div>

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