SCP Command Tutorial: Secure File Transfer Made Simple with Remote.It
Securely copying files between computers is a common task for developers, system administrators, and IT professionals. Whether you’re managing remote servers or moving configuration files across environments, the SCP (Secure Copy Protocol) command is a reliable, simple tool for the job.
This tutorial walks through the basics of the SCP command — how it works, how to use it, and how Remote.It removes the friction that typically surrounds remote file transfer. With Remote.It, you can use SCP to connect to devices anywhere in the world, without worrying about public IP addresses, NAT traversal, firewall rules, or network ACLs.
What is SCP?
SCP stands for Secure Copy Protocol, and it enables file transfer between hosts on a network. It runs over SSH (Secure Shell) and provides encryption and authentication, ensuring that your data is protected in transit.
The typical syntax for the SCP command looks like this:
scp [options] source destination
It works both ways:
- Copy a file to a remote host
- Copy a file from a remote host to your local system
SCP command examples
Copy-paste examples for the transfers people search for most. In each one, user@remote-host is the SSH login on the other machine; replace it with your own (for example pi@192.168.1.20).
SCP command to copy a file from local to remote
Put the local file first and the remote destination second:
scp report.pdf user@remote-host:/home/user/documents/
To give the copy a new name on the remote side, end the destination with the file name instead of a directory:
scp report.pdf user@remote-host:/home/user/documents/report-2026.pdf
SCP command to copy a file from remote to local
Swap the order: the remote file comes first, the local destination second. . means “the folder I’m in now”:
scp user@remote-host:/var/log/syslog .
scp user@remote-host:/home/user/backup.tar.gz ~/Downloads/
Copy an entire directory
Add -r (recursive) to copy a folder and everything in it, in either direction:
scp -r ./website user@remote-host:/var/www/
scp -r user@remote-host:/etc/nginx ~/nginx-backup/
Copy several files at once
List the files before the destination, or use a wildcard. Quote a remote wildcard so your local shell doesn’t expand it first:
scp notes.txt config.yaml user@remote-host:/tmp/
scp 'user@remote-host:/var/log/*.log' ./logs/
Use a different SSH port
SCP takes the port with a capital -P (lowercase -p means something else, see below):
scp -P 2222 report.pdf user@remote-host:/home/user/
Use a specific SSH key
scp -i ~/.ssh/my-server-key report.pdf user@remote-host:/home/user/
Keep timestamps, compress, or show more detail
-pkeeps the original modification times and permissions.-Ccompresses data in transit, which helps on slow links.-vprints the SSH conversation, the first thing to try when a copy fails.
scp -p -C large-file.iso user@remote-host:/data/
Copy between two remote hosts
Name both remotes. -3 routes the data through your machine, which works even when the two hosts can’t reach each other:
scp -3 user@host-a:/data/export.csv user@host-b:/data/
SCP on Windows
Windows 10 (version 1809 and later) and Windows 11 include the OpenSSH client, so scp works in PowerShell or Command Prompt with no extra software. Use Windows paths for the local side:
scp C:\Users\me\Documents\report.pdf user@remote-host:/home/user/
scp user@remote-host:/home/user/backup.tar.gz C:\Users\me\Downloads\
If scp isn’t recognized, add OpenSSH Client under Settings → Optional features.
Common Pitfalls with SCP
While SCP is powerful and easy to use, there are a few challenges when transferring files between networks:
- 🔒 Firewall rules: Remote servers often block inbound SSH unless manually configured.
- 🌐 No public IP: Devices behind NAT (e.g., home routers or cellular gateways) are unreachable unless port forwarding is configured.
- 🧱 ACLs and network policies: IT admins may need to approve or whitelist your IP before access is granted.
These issues lead to delays, IT overhead, and often, physical site visits — especially for IoT or edge deployments.
Enter Remote.It: SCP with Zero Network Configuration
Remote.It eliminates all of these network headaches. It provides secure, private connectivity to any device without needing public IPs, firewall changes, or VPNs.
With Remote.It:
- You don’t need to know the device’s IP address.
- No port forwarding or NAT traversal is required.
- You can connect over SCP as if the device were on your local network.
🔧 How it works:
Remote.It acts as a private proxy layer that wraps services like SSH/SCP in a secure tunnel. When you register a device and its SSH port with Remote.It, the platform assigns a proxy endpoint you can connect to using standard tools like scp, ssh, or even file explorers.
Using SCP with Remote.It
Here’s how you can use SCP to copy files to and from a device registered with Remote.It.
1. Register your device and service
- Install the Remote.It agent on your target device.
- Register the device and its SSH port (usually port 22) using the Remote.It web app, CLI, or SDK.
2. Start a Remote.It proxy for SCP
Use the CLI to start a connection:
remoteit connection connect --id <SERVICE_ID>
This will return a localhost endpoint, like:
127.0.0.1:33000
3. Use SCP as if the device were local
scp -P 33000 myfile.txt user@127.0.0.1:/path/to/destination/
That’s it. The file transfers securely to your remote device, even if it’s behind multiple layers of NAT or firewalls.
Why This Matters
Here’s how Remote.It changes the game for file transfer workflows:
- ✅ Works from anywhere – No need to be on the same LAN or VPN.
- ✅ Private-by-default – No public exposure of ports or IPs.
- ✅ Instant access – No waiting on IT to configure firewall rules or ACLs.
- ✅ IoT-ready – Ideal for edge devices, sensors, and smart gateways.
- ✅ Scalable – Use the same workflow whether managing one device or thousands.
If you’re building and managing devices at scale — or just want a more reliable way to move files without touching network settings — Remote.It is the easiest way to integrate SCP into your workflow.
Final Thoughts
SCP remains a trusted tool for secure file transfers, but its usefulness is often limited by network constraints. Remote.It removes those constraints.
By combining the simplicity of SCP with Remote.It’s flexible connectivity, you get the best of both worlds: encrypted file transfer with zero network configuration.
So the next time you need to copy files to a device behind a firewall, skip the port forwarding. Just use SCP with Remote.It.