How to use scp to transfer files to a specific container?

I know I can use ssh -t -p 22222 root@device-ip "balena-engine exec -it <container_name> /bin/sh" to grant access to a specific container within the balenaos host. Now I need to use scp to transfer files to a container. What would be the correct syntax that results in scp connecting to this container in the same way the aforementioned ssh command does?

1 Like

Hello @KF95 thanks for your message.

Are you trying to send a file from your local computer to your device’s container? Did you check this open issue? Are you using balena CLI?

I usually do it the other way round with a curl. But it always depends on the use cases.