# add SSH key after provisioning to production device?

**URL:** <https://forums.balena.io/t/add-ssh-key-after-provisioning-to-production-device/350886>\
**Category:** balenaOS\
**Tags:** ssh\
**Created:** [January 11, 2022, 9:12pm UTC](https://forums.balena.io/t/add-ssh-key-after-provisioning-to-production-device/350886 "2022-01-11T21:12:19Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![PackElend](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@PackElend](https://forums.balena.io/u/PackElend)\
**Post date:** [January 20, 2022, 8:16pm UTC](https://forums.balena.io/t/add-ssh-key-after-provisioning-to-production-device/350886/7 "2022-01-20T20:16:11Z")

</div>

@Hades32 I got WSL2 up and balena-cli running in it, see [How-To: How install balena-cli in WSL2 if behind Proxy like Zscaler - Product support / balenaOS - balenaForums](https://forums.balena.io/t/how-to-how-install-balena-cli-in-wsl2-if-behind-proxy-like-zscaler/350969).  
I tried now [balena-io-playground/ssh-key-insert: Tooling to insert the relevant SSH keys into balena devices’ configuration. (github.com)](https://github.com/balena-io-playground/ssh-key-insert) but I get

```auto
:~/balena.io/ssh-key-insert-master$ bash -x ./run.sh
+ cat batch
+ stdbuf -oL xargs '-I{}' -P 10 /bin/sh -c 'grep -a -q '\''{} : DONE'\'' sshkey.log || (cat add-ssh-key.sh | balena ssh {} | sed '\''s/^/{} : /'\'' | tee --append sshkey.log)'
<usedr-name>@ssh.balena-devices.com: Permission denied (publickey).
Warning: ssh process exited with non-zero code "255"

Are the SSH keys correctly configured in balenaCloud? See:
https://www.balena.io/docs/learn/manage/ssh-access/#add-an-ssh-key-to-balenacloud
Are you accidentally using `sudo`?

```

I’m still clueless about which key is expected for what action and how keys are distributed…?

---

_[View the full topic](https://forums.balena.io/t/add-ssh-key-after-provisioning-to-production-device/350886)._
