Secure File Transfer (scp)
Concept & Overview
Now that you know how to log into a remote server via SSH, how do you copy a local file (like a backup archive) to it? The scp (secure copy) command copies files securely between hosts using SSH under the hood.
- The syntax is scp source_path user@host:destination_path.
- E.g., scp log.txt admin@192.168.1.100:/tmp/ copies the local log.txt file to the remote /tmp/ folder.
Note: Just like with ssh, there's no real remote server here — running this command confirms your local file exists and shows you the expected transfer output, but doesn't actually send data anywhere.
logs.tar.gz to the /tmp folder on 192.168.1.100 as the admin user by running scp logs.tar.gz admin@192.168.1.100:/tmp/.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
scp logs.tar.gz admin@192.168.1.100:/tmp/ | Copy logs.tar.gz to remote server /tmp folder |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Transfer logs.tar.gz to 192.168.1.100:/tmp/ via scp
Ready to complete Quest 140?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.