# how is the SSH key added to balenaCloud used?

**URL:** <https://forums.balena.io/t/how-is-the-ssh-key-added-to-balenacloud-used/351019>\
**Category:** Product support\
**Tags:** ssh\
**Created:** [January 21, 2022, 11:35am UTC](https://forums.balena.io/t/how-is-the-ssh-key-added-to-balenacloud-used/351019 "2022-01-21T11:35:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 21, 2022, 4:37pm UTC](https://forums.balena.io/t/how-is-the-ssh-key-added-to-balenacloud-used/351019/3 "2022-01-21T16:37:54Z")

</div>

thx a lot that helps me a lot, so get out of my mess

1. add OpenSSH public key (not putty key) to Balena Cloud
2. open `balena-cli`
3. `balena-cli -> login`
4. `bash -x ./run.sh` of [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) to add penSSH public key to device
5. `balena-cli -> logout`
6. open terminal of OS
7. using OS’s `ssh` to login into production directly

correct?

If so, final question, where does` balena-cli` expect the private ssh-key to be stored using

- Windows
- Windows Subsystem Linux

as I cannot use the `-i` flag in case of `balena-cli -> ssh` so I have to store the key where it is expected what is properly not the case so that is why I get:

```auto
...@ssh.balena-devices.com: Permission denied (publickey).
Warning: ssh process exited with non-zero code "255"

```

as mentioned in [Balena ssh fails with Permission denied (publickey) - Product support / balenaOS - balenaForums](https://forums.balena.io/t/balena-ssh-fails-with-permission-denied-publickey/4863/14)

---

_[View the full topic](https://forums.balena.io/t/how-is-the-ssh-key-added-to-balenacloud-used/351019)._
