# balena ssh suddenly stopped working

**URL:** <https://forums.balena.io/t/balena-ssh-suddenly-stopped-working/370335>\
**Category:** balenaOS\
**Tags:** ssh\
**Created:** [April 18, 2024, 7:06pm UTC](https://forums.balena.io/t/balena-ssh-suddenly-stopped-working/370335 "2024-04-18T19:06:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blaise](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@Blaise](https://forums.balena.io/u/Blaise)\
**Post date:** [April 18, 2024, 7:06pm UTC](https://forums.balena.io/t/balena-ssh-suddenly-stopped-working/370335/1 "2024-04-18T19:06:39Z")

</div>

Literally yesterday I was using the `balena tunnel` command successfully to tunnel `localhost:4321` to `<device-uuid>:22222`.

I added my public RSA key to the Balena dashboard. Then, I ran

```shell
balena tunnel <device-uuid> -p 22222:4321

```

Then, in a separate terminal, I used the ssh command like so

```shell
 ssh -L 8443:192.168.0.201:443 -p 4321 -i /path/to/private/key <username>@127.0.0.1

```

This worked very well. However, this morning when I tried to do the same thing, I get this error from the ssh cli

```shell
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/bm/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/bm/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/bm/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 4321.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address 127.0.0.1 port 4321: Connection refused
ssh: connect to host 127.0.0.1 port 4321: Connection refused

```

I also tried this

```shell
balena ssh <device-uuid>
-----------------------------------------------------------------------
[Warn] Node.js version "21.7.2" does not satisfy requirement ">=18 <20"
[Warn] This may cause unexpected behavior.
-----------------------------------------------------------------------
(node:34594) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
blaise1@ssh.balena-devices.com: Permission denied (publickey).
SSH: Remote command "host <device-uuid>" exited with non-zero status 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`?

```

but it tells me that I might have the wrong public key, which is not true since I checked that countless times. What else do I need to do to make this work?

---

<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:** [May 9, 2024, 10:29am UTC](https://forums.balena.io/t/balena-ssh-suddenly-stopped-working/370335/2 "2024-05-09T10:29:59Z")

</div>

Hello @Blaise apologizes for the long delay answering here!

Could you please confirm if this is working now on your side?
