Open pdcastro opened 3 years ago
It is possible to pipe a command to balena ssh <UUID> and get it executed on the host OS:
balena ssh <UUID>
$ echo 'pwd; exit;' | DEBUG=1 balena ssh 21c67b8 ... [debug] [/usr/bin/ssh, -t, -o, LogLevel=ERROR, -o, StrictHostKeyChecking=no, -o, UserKnownHostsFile=/dev/null, gh_paulo_castro@ssh.balena-devices.com, host 21c67b8d08ac75f2aa457274050ea01c] ============================================================= Welcome to balenaOS ============================================================= /home/root
However, the same does not work to run a command in a container / service, i.e. balena ssh <UUID> <service-name>:
balena ssh <UUID> <service-name>
$ echo 'pwd; exit;' | DEBUG=1 balena ssh 21c67b8 foo ... [debug] [/usr/bin/ssh, -t, -o, LogLevel=ERROR, -o, StrictHostKeyChecking=no, -o, UserKnownHostsFile=/dev/null, gh_paulo_castro@ssh.balena-devices.com, enter 21c67b8d08ac75f2aa457274050ea01c dcad1660ec1a4d61b797957a422506d8ac6d22af5f0417e0c833c46627ddb021]
I understand this is a limitation of the balena-proxy backend service, which prevents stdin from being piped through to a container. The following issue needs to be resolved first: https://github.com/balena-io/balena-proxy/issues/466 (private repo).
balena-proxy
Known Workarounds
balena-engine exec
ssh
balena ssh
It is possible to pipe a command to
balena ssh <UUID>
and get it executed on the host OS:However, the same does not work to run a command in a container / service, i.e.
balena ssh <UUID> <service-name>
:I understand this is a limitation of the
balena-proxy
backend service, which prevents stdin from being piped through to a container. The following issue needs to be resolved first: https://github.com/balena-io/balena-proxy/issues/466 (private repo).Known Workarounds
balena-engine exec
on the host OS:https://github.com/balena-io/balena-cli/issues/1482#issuecomment-624278963
ssh
instead ofbalena ssh
:https://github.com/balena-io/balena-cli/issues/1482#issuecomment-631596939