Receive files from remote device (scp)

How to copy files to or from a remote device

Sometimes a workflow demands to receive files from a remote edge device like a Raspberry Pi. One example could be a log file that needs further analysis. Alternatively, you might need to copy a file to the device. When the device is not in the same local network and behind a firewall this can be a lot of hassle. In this example we will show you a workflow which uses qbee-connect to download the syslog file from a remote device. This gives you a simple solution to transfer files from an edge device or to an edge device.

qbee allows you to work with files on remote devices in a few different ways. These are:

  • file distribution through the integrated file manager: This works from the system to the edge device and applies full configuration management principles
  • remote two-way file access through scp as described in this guide
  • remote two-way file and folder syncronization with rsync as described here
  • remote file browsing capabilities with sshfs as described here

Task - download remote syslog file

  • open qbee-connect on your machine and connect to the remote device with ssh on port 22 qbee-connect-prepare-scp
  • qbee-connect maps port 22 on a different local host port. In this case it is 62530
  • run a scp command from your local machine to the remote device using the -P command to use the mapped port
    scp -P 62530 root@localhost:/var/log/syslog syslog_ctr-700
    
  • this copies the remote syslog file to the local device qbee-terminal-scp
  • task completed. This works also across firewalls or NATs.

If you are on Windows and want a graphical UI you can also look at the free tool WinSCP. This allows to do the whole process graphically.

Please configure it like this. The port is the port mapped by qbee-connect.

qbee-connect-winscp

Then you will have full access to the remote file system:

qbee-connect-winscp-full

This works of course in both directions and is just another example how you can use the port mapping functionality of qbee to achieve a simple file transfer. Here is a short remote file transfer video showing the above.