Copy Files Securely with scp

Transfer a file to another machine over SSH with one command.

macOSsshscpsecurityLow risk
Run `scp ~/Documents/report.pdf alice@192.168.1.20:~/Documents/` to copy it into that user's Documents folder.

01Command

Command
$ scp ~/Documents/report.pdf alice@192.168.1.20:~/Documents/

02What it does

scp ships with macOS and encrypts the whole transfer, so it's the go-to for sending files to another Mac, a home server, or a VPS without a USB stick. The destination uses user@host:path; to copy in the other direction, put the remote path first. Add `-r` to copy a whole folder and `-P 2222` if the SSH server uses a non-standard port.

03Risk

RiskLow risk
!Warning: Remote login must be enabled on the target Mac (System Settings > General > Sharing > Remote Login).

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • scp — secure copy (OpenSSH man page)
    OpenBSD · vendor-doc · 2026-09-17
    Evidence: Documents scp copying files between hosts over SSH and the user@host:path remote destination syntax used on macOS's OpenSSH.

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions