# Balena ssh fails with Permission denied (publickey)

**URL:** <https://forums.balena.io/t/balena-ssh-fails-with-permission-denied-publickey/4863>\
**Category:** balenaOS\
**Created:** [January 2, 2019, 2:08am UTC](https://forums.balena.io/t/balena-ssh-fails-with-permission-denied-publickey/4863 "2019-01-02T02:08:57Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![nick-rozanski](https://avatars.discourse-cdn.com/v4/letter/n/b2d939/32.png) [@nick-rozanski](https://forums.balena.io/u/nick-rozanski)\
**Post date:** [April 12, 2020, 2:37pm UTC](https://forums.balena.io/t/balena-ssh-fails-with-permission-denied-publickey/4863/14 "2020-04-12T14:37:13Z")

</div>

Three things to check if SSH is not working:

1. Check that the SSH key has been uploaded to balena (Preferences -\> SSH keys). Take a copy of the key.
2. Check that the public key file ~/.ssh/id\_rsa.pub exists, and has the same contents as the uploaded key from check 1.
3. Check that you have a private key file ~/.ssh/id\_rsa which corresponds to the public key you checked in check 2.  
This got balena ssh working for me on MacOS. (The key creation command is ssh-keygen -t rsa)

---

_[View the full topic](https://forums.balena.io/t/balena-ssh-fails-with-permission-denied-publickey/4863)._
