SCP file copy

Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.


SCP (Secure Copy Protocol) is a secure file transfer tool based on SSH. It is used to transfer files and directories between a local host and the Quectel Pi M2 Debian system in an encrypted manner. Before using SCP, confirm that the SSH service on the Quectel Pi M2 is running, the computer and the development board have network connectivity, and the local host can complete user authentication via password or SSH key.

This document verifies that local upload, remote download, and recursive directory copy all work correctly on the Quectel Pi M2 Debian system. In actual use, use the board’s current IP address, actual username, and corresponding authentication method.

Common Scenarios

All commands below are executed in the local command-line terminal.

  • Transfer files between a local host and a remote host (local → remote):

scp /local/file.txt username@Quectel-Pi-IP:/target/path/

Example:

scp ~/test.zip q@<board-IP>:/home/q/  # Copy to the remote host's home directory
  • Transfer files between two remote hosts (remote → remote):

scp user1@host1:/path/to/file user2@host2:/path/to/dest/

Example:

scp alice@server1:/data/report.txt bob@server2:/backups/
  • Transfer files between a remote host and a local host (remote → local):

scp username@Quectel-Pi-IP:/remote/file.txt /local/path/

Example:

scp q@<board-IP>:/home/q/test.log ./downloads/  # Download a remote file to local

Recursive Directory Copy

Copy an entire folder (including sub-files and sub-directories):

scp -r /local/directory/ username@Quectel-Pi-IP:/target/path/

Example:

scp -r ~/my_project/ q@<board-IP>:/home/q/