# SSH keys don't pass through from Balena UI to config.json (RPi 4)

**URL:** <https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525>\
**Category:** Product support\
**Tags:** raspberrypi4\
**Created:** [August 30, 2021, 8:22pm UTC](https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525 "2021-08-30T20:22:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![al2ka](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@al2ka](https://forums.balena.io/u/al2ka)\
**Post date:** [August 30, 2021, 8:22pm UTC](https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525/1 "2021-08-30T20:22:57Z")

</div>

Hi Balena,

We found that we were unable to establish a tunnel using the Balena CLI successfully to forward port 22222 as standard to localhost or SSH even though SSH keys were provided in the Balena UI prior to connecting.

The error received was "Permission denied (publickey).

To fix this we manually edited config.json in /mnt/boot/ and could then connect, however this was a manual process so can’t be repeated if keys need to be changed across fleets etc.

Is this a bug or should config.json have been updated automatically after provision of the keys in the Balena UI? It would appear so but we found it wasn’t the case.

Many thanks,

Alasdair

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [August 31, 2021, 6:59am UTC](https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525/2 "2021-08-31T06:59:52Z")

</div>

Hello @al2ka check this link [SSH access - Balena Documentation](https://www.balena.io/docs/learn/manage/ssh-access/#using-a-standalone-ssh-client)

there are different options:

1. using balena CLI (`balena ssh`)?
2. using `username` instead of `root`?
3. maybe `preload` images with the config.json already populated with the keys if any of the previous ones work?

---

<div class="post-metadata">

**Author:** ![al2ka](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@al2ka](https://forums.balena.io/u/al2ka)\
**Post date:** [September 5, 2021, 3:08pm UTC](https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525/4 "2021-09-05T15:08:58Z")

</div>

Hi Marc,

Looks like this feature isn’t quite available via the Balena UI (adding SSH keys to config.json using keys added to Balena in the cloud via preferences).

Answer is [here](https://forums.balena.io/t/adding-ssh-key-after-flashing/23905/10) and a workaround is to use the Configurizer app - [https://github.com/balena-os/configizer](https://github.com/balena-os/configizer)

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [September 7, 2021, 8:21am UTC](https://forums.balena.io/t/ssh-keys-dont-pass-through-from-balena-ui-to-config-json-rpi-4/346525/5 "2021-09-07T08:21:33Z")

</div>

Thank you @al2ka to confirm that my solution does not work. I will read the proper solution and update docs (if needed).

Does this solution using `configizer` work for you?
