SSH Permission denied (publickey) gotcha

if you get

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

it might mean your balena cloud ssh key (https://dashboard.balena-cloud.com/preferences/sshkeys) is out of date

the fact that balena cli is otherwise working DOES not mean you SSH keys are up to date which is the mistake i was making

it might be worth documenting this somewhere maybe in the faqs

Thanks for the suggestion. I’ll create a ticket so we can hopefully improve the docs!

1 Like

Thanks for the contribution, just wanted to let you know the PR has now been merged and your changes should be available from version v12.7.4 onwards.

So, how do we update them?

I’ve got a device that’s showing offline for a couple of weeks and I can’t ssh into it to see what the issue is.

Hi James,

That sounds like potentially a different issue. If your device is reporting as offline, it’s not connecting to the dashboard for some reason. You can scan your local network using the Balena CLI with balena scan to see if it’s online, however.

Additionally, if this is indeed a separate issue, it would be a good idea to create another thread to make it easier to keep track of and help you diagnose your problem.