Lesson 27 / 29

scp & Checking Connectivity

Copying files over SSH, and confirming a host is reachable.

scp — copy over SSH

scp copies files to or from a remote machine using the same auth as SSH.

scp report.pdf alice@myserver.com:/home/alice/
scp alice@myserver.com:/var/log/app.log ./app.log

Checking connectivity

ping tests basic reachability. curl -I checks whether a web service responds.

ping -c 4 google.com
curl -I https://example.com

Output:

4 packets transmitted, 4 received, 0% packet loss
HTTP/1.1 200 OK

Quick check: Which command copies a file to a remote server over SSH?

  • ssh
  • scp
  • ping
Answer

scp — scp (secure copy) transfers files using the SSH protocol.