Copy Across the Wire: the scp Round Trip
EasyLinux Fundamentals10-15 minscp is cp that understands other machines. Same grammar — source, then destination — except a remote side is written host:path. Your key auth to the labbox (port 2222) is already set up; this lab is pure file-moving, in both directions.
The labbox serves as a fileserver today:
1. PUSH — deliver your briefing: /root/outbox/mission-brief.txt → labbox:/srv/dropzone/
2. PULL — fetch the warehouse manifest: labbox:/srv/warehouse/manifest-07.txt → /root/inbox/
3. PUSH A DIRECTORY — ship the whole evidence folder: /root/outbox/evidence/ → labbox:/srv/dropzone/evidence (directories need -r)
Remember the port trap: ssh takes -p 2222 but scp takes CAPITAL -P 2222 (lowercase -p means 'preserve timestamps'). The shape is scp -P 2222 SOURCE DEST, with a remote side written host:path — for this box, root@localhost.
Grading compares file contents byte-for-byte between source and destination. (Yes — since the labbox shares this sandbox, plain cp would technically pass. You'd be practicing nothing; every real server in your future disagrees with that shortcut.)
- Push /root/outbox/mission-brief.txt to /srv/dropzone/ on the labbox with scp
- Pull /srv/warehouse/manifest-07.txt from the labbox into /root/inbox/
- Push the whole /root/outbox/evidence directory to /srv/dropzone/evidence with scp -r
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
