Is it possible to transfer files from a device to a local machine?

For debugging purposes I am looking for a way to quickly inspect an image file created in the device container on my local machine. Something like resin scp resin_uuid /path/to/remote/file /path/to/local. I know about resin sync but it works the other way round.

:speech_balloon:You could resin ssh into the application container and execute a command to push the file out.

What do you mean exactly when you say “push the file out” ? uploading it to a server ?

Yes, instead of running scp on your development machine to pull a remote (resin) file to your local (dev machine) file system, you could run scp on the resin device to push a local (resin) file to a remove (dev machine) file system.

Thank you for your reply. I will try this. The problem is that my local machine does not have a static IP to connect to.

What about your hostname, do they resolve to IP on your network?

For my own small testing I was using
(send the file out of the device, and download it to your development machine)


Indeed this is a great solution. Thanks a lot.

scp works both ways for me. WinSCP is also convenient (change the file protocol from the default SFTP to SCP).

Hi, Im bumping this topic, because it’s related to my problem. I would like to download whole source of the containter running on raspberry pi device on balena cloud. I am looking for the solution. SCP looks ok for me since I do not see something different like for example balena pull (the opposite of push), but I dont know how to set up the connection to be able to run scp.

balena ssh - returns
Permission denied (publickey).
balena tunnel hangs on:
[Info] - tunnelling localhost:2222 to :22222
[Info] Waiting for connections…

I assume that I should set up the tunnel and then run SCP, am I right?

Hello, what are the commands you were trying to run here? I would expect scp to work if you run balena tunnel <device id> -p <port on localhost> and then in another terminal scp -P localhost:/path/to/src ./

Having same issue. Just found that my SSH key is NOT copied to the devices, so thats why I cannot connect. And found this, it’s probably causing the issue:

Note: Host OS SSH access is available for devices running balenaOS version 2.7.5 and above.