# Error SSH to device via balena-cli

**URL:** <https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855>\
**Category:** openBalena\
**Created:** [December 29, 2018, 11:47pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855 "2018-12-29T23:47:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlev](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rlev](https://forums.balena.io/u/rlev)\
**Post date:** [December 29, 2018, 11:47pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/1 "2018-12-29T23:47:01Z")

</div>

- **Cli version:** 9.7.0
- **Standalone install:** no
- **Node version:** 8.11.4
- **Npm version:** 6.5.0
- **Operating system and architecture:** Linux Ubuntu 18.04.1 LTS

> $ balena device 79a1dd9  
> == HIDDEN SKY  
> ID: 8  
> DEVICE TYPE: imx6ul-var-dart  
> STATUS: idle  
> IS ONLINE: true  
> APPLICATION NAME: imx6ulApp  
> UUID: 79a1dd9c1bacdc79661d1afd31e7c52b  
> COMMIT: fc2e2716d8c8913ae434a0f05f9ed713  
> SUPERVISOR VERSION: 8.6.3  
> OS VERSION: balenaOS 2.28.0+rev2  
> DASHBOARD URL: [https://dashboard.mydomain.com/devices/79a1dd9c1bacdc79661d1afd31e7c52b/summary](https://dashboard.mydomain.com/devices/79a1dd9c1bacdc79661d1afd31e7c52b/summary)

But when :

> $ balena ssh 79a1dd9  
> Connecting to: 79a1dd9  
> BalenaRequestError: Request error: tunneling socket could not be established, cause=connect ECONNREFUSED 172.18.0.6:3128

If you need help, don’t hesitate in contacting us at:

GitHub: [Sign in to GitHub · GitHub](https://github.com/balena-io/balena-cli/issues/new)  
Forums: [https://forums.balena.io](https://forums.balena.io)

**Any clues ?**

---

<div class="post-metadata">

**Author:** ![dash](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dash](https://forums.balena.io/u/dash)\
**Post date:** [December 30, 2018, 11:05pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/4 "2018-12-30T23:05:16Z")

</div>

Hi @rlev,

This issue appears to be unrelated to ssh domain name.

I looks like it is more likely something to do with network configuration on either host instance or remote device.

I believe 172.18.0.6 is the IP of address of your remote device running Balena host OS? The first thing I would do is start using some network tools like telnet to check that your Balena instance can reach the device at that IP and then check if there is anything listening on that port.

$ telnet 172.18.0.6 3128

Cheers  
Chris

---

<div class="post-metadata">

**Author:** ![violuke](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/violuke/32/1282_2.png) [@violuke](https://forums.balena.io/u/violuke)\
**Post date:** [January 7, 2019, 11:09am UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/5 "2019-01-07T11:09:04Z")

</div>

Hi @dash

I’m getting the same problem. I also get the same thing for the `device reboot` and `device shutdown` commands. The IP address shown in my case is `172.18.0.7`. This is not the device IP, but the IP of the `balena/open-balena-registry` Docker container as per the below:

```
# docker exec openbalena_registry_1_7b865c92e558 ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
254: eth0@if255: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ac:12:00:07 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.18.0.7/16 brd 172.18.255.255 scope global eth0
       valid_lft forever preferred_lft forever

```

Anyone got an ideas? Thanks

---

<div class="post-metadata">

**Author:** ![dash](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dash](https://forums.balena.io/u/dash)\
**Post date:** [January 7, 2019, 12:31pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/6 "2019-01-07T12:31:32Z")

</div>

@violuke see @richbayliss’s response to this thread:

> [@SSH: Could not resolve hostname](https://forums.balena.io/t/ssh-could-not-resolve-hostname/4848/10):
>
> @dash: Thanks for the reply. I will keep under control the SSH feature on openBalena for an official solution. Up to now I was able to access a Balena device by: Installing on the device host OS a protected SSH daemon which allows access only from the openBalena VPN IP range Entering in the open-balena-VPN container Launching the SSH command to reach the device’s VPN IP associated It’s far from being a decent solution but at least, it allows remote support using openBalena …

SSH is a work in progress for openBalena, I suspect the same for reboot and shutdown.

Cheers  
Chris

---

<div class="post-metadata">

**Author:** ![violuke](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/violuke/32/1282_2.png) [@violuke](https://forums.balena.io/u/violuke)\
**Post date:** [January 7, 2019, 2:26pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/7 "2019-01-07T14:26:53Z")

</div>

Ah, thanks Chris, I’d not seen that, makes sense 👍

---

<div class="post-metadata">

**Author:** ![dfunckt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dfunckt/32/56_2.png) [@dfunckt](https://forums.balena.io/u/dfunckt)\
**Post date:** [January 7, 2019, 3:51pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/8 "2019-01-07T15:51:12Z")

</div>

Do note that _local_ SSH works, remote isn’t and it’s what we’re working on. That means if you need to SSH into devices on your local network you can do so with `balena ssh LOCAL_DEVICE_IP`.

---

<div class="post-metadata">

**Author:** ![dfunckt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dfunckt/32/56_2.png) [@dfunckt](https://forums.balena.io/u/dfunckt)\
**Post date:** [January 7, 2019, 3:51pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/9 "2019-01-07T15:51:20Z")

</div>

Do note that local SSH works, remote isn’t and it’s what we’re working on. That means if you need to SSH into devices on your local network you can do so with balena ssh LOCAL\_DEVICE\_IP.

---

<div class="post-metadata">

**Author:** ![richbayliss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/richbayliss/32/1054_2.png) [@richbayliss](https://forums.balena.io/u/richbayliss)\
**Post date:** [February 13, 2019, 2:47pm UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/11 "2019-02-13T14:47:45Z")

</div>

I thought you might like to follow these steps to get SSH working to your devices on openBalena… [SSH into host device](https://forums.balena.io/t/ssh-into-host-device/5312)

This is a workaround until we get the balena CLI updated to include it directly 👌

---

<div class="post-metadata">

**Author:** ![rlev](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rlev](https://forums.balena.io/u/rlev)\
**Post date:** [February 15, 2019, 11:14am UTC](https://forums.balena.io/t/error-ssh-to-device-via-balena-cli/4855/19 "2019-02-15T11:14:34Z")

</div>

Thank you for the guide @richbayliss
