Copy Files Securely with scp
Transfer a file to another machine over SSH with one command.
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
!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)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